Вам нужно написать программу, которая содержит только требуемую функцию (можно несколько функций, если одна функция будет вызывать другую). Программа не должна содержать никакого кода вне функций.
В тестирующей системе после вашей программы будет добавлен следующий код, после чего решение будет проверено на тестах.
print(average(list(map(float, input().split()))))
print(median(int(input()), int(input()), int(input())))
res = is_point_in_square(float(input()), float(input()))
if type(res) != bool:
print("Функция должна возвращать значение типа bool")
elif res:
print("YES")
else:
print("NO")
res = is_point_in_rhombus(float(input()), float(input()))
if type(res) != bool:
print("Функция должна возвращать значение типа bool")
elif res:
print("YES")
else:
print("NO")
res = is_point_in_circle(float(input()), float(input()), float(input()), float(input()), float(input()))
if type(res) != bool:
print("Функция должна возвращать значение типа bool")
elif res:
print("YES")
else:
print("NO")
res = is_point_in_area(float(input()), float(input()))
if type(res) != bool:
print("Функция должна возвращать значение типа bool")
elif res:
print("YES")
else:
print("NO")
res = reverse(int(input()))
if type(res) == int:
print(res)
else:
print("Функция должна возвращать значение типа int")
res = next_palindrome(int(input()))
if type(res) == int:
print(res)
else:
print("Функция должна возвращать значение типа int")
for __i in range(2, int(input())):
d = min_divisor(__i)
print(__i, d)
for __i in range(2, int(input())):
res = is_prime(__i)
if type(res) != bool:
print("Функция is_prime(" + str(__i) + ") вернула значение не типа bool")
elif res:
print(__i, "YES")
else:
print(__i, "NO")
for __i in range(int(input()), int(input()) + 1):
print(__i, factor(__i))
__n = int(input())
res = product_of_digits(__n)
if type(res) != int:
print("Функция должна возвращать значение типа int")
else:
print(res)
output = ""
for __x in [False, True]:
for __y in [False, True]:
res = xor(__x, __y)
if type(res) != bool:
print("Функция должна возвращать значение типа bool")
sys.exit(0)
output += "x = {0}, y = {1}, res = {2}\n".format(__x, __y, res)
print(output, end="")
output = ""
for __x in [False, True]:
for __y in [False, True]:
res = imp(__x, __y)
if type(res) != bool:
print("Функция должна возвращать значение типа bool")
sys.exit(0)
output += "x = {0}, y = {1}, res = {2}\n".format(__x, __y, res)
print(output, end="")
output = ""
for __x in [False, True]:
for __y in [False, True]:
for __z in [False, True]:
res = major(__x, __y, __z)
if type(res) != bool:
print("Функция должна возвращать значение типа bool")
sys.exit(0)
output += "x = {0}, y = {1}, z = {2}, res = {3}\n".format(__x, __y, __z, res)
print(output, end="")
__a = list(map(int, input().split()))
res = histogram(__a)
if res is not None:
print("Функция НЕ должна возвращать значение")
__n = int(input())
res = triangle(__n)
if res is not None:
print("Функция НЕ должна возвращать значение")
__a, __b = map(int, input().split())
res = fir(__a, __b)
if res is not None:
print("Функция НЕ должна возвращать значение")
res = read_even()
if type(res) != list:
print("Функция должна возвращать список")
sys.exit(0)
for elem in res:
if type(elem) != int:
print("Все элементы списка должны иметь тип int")
sys.exit(0)
print(res)
__x = int(input())
res = read_greater(__x)
if type(res) != list:
print("Функция должна возвращать список")
sys.exit(0)
for elem in res:
if type(elem) != int:
print("Все элементы списка должны иметь тип int")
sys.exit(0)
print(res)
res = read()
if type(res) != list:
print("Функция должна возвращать список")
sys.exit(0)
for elem in res:
if type(elem) != int:
print("Все элементы списка должны иметь тип int")
sys.exit(0)
print(res)
print("Несчитанный остаток входных данных:")
print(sys.stdin.read())
res = read()
if type(res) != int:
print("Функция должна возвращать значение типа int")
sys.exit(0)
print(res)
print("Несчитанный остаток входных данных:")
print(sys.stdin.read())
__k = int(input())
res = read(__k)
if type(res) != list:
print("Функция должна возвращать список")
sys.exit(0)
for elem in res:
if type(elem) != int:
print("Все элементы списка должны иметь тип int")
sys.exit(0)
print(res)
total_sum = 0
for line in sys.stdin:
__a = list(map(int, line.split()))
print(__a)
res = sum_list(__a)
if res is not None:
print("Функция НЕ должна возвращать значение")
sys.exit(0)
print(total_sum)
max_digit_value = 0
for line in sys.stdin:
__n = int(line)
print(__n)
res = max_digit(__n)
if res is not None:
print("Функция НЕ должна возвращать значение")
sys.exit(0)
print(max_digit_value)
__count = int(input())
for i in range(__count):
res = read()
if type(res) != bool:
print("Функция должна возвращать значение типа bool")
sys.exit(0)
print(res)
print(prev)