输入样例 1:
13 1 2 3 4 5 6 7 8 9 10 20 16 18
输出样例 1:
30 11 2 9.7 9
输入样例 2:
8 1 2 4 5 6 7 9 16
输出样例 2:
N 11 2 N 9
# -*- coding: utf-8 -*-def class_numbers(nums):arr = [0] * 5exists = [0] * 5flag1 = 1for num in nums:if num % 5 == 0 and num % 2 == 0:arr[0] += numexists[0] += 1if num % 5 == 1:arr[1] += flag1 * numflag1 = -1 * flag1exists[1] += 1if num % 5 == 2:arr[2] += 1exists[2] += 1if num % 5 == 3:arr[3] += numexists[3] += 1if num % 5 == 4:if num > arr[4]:arr[4] = numexists[4] += 1if exists[3]:arr[3] = round(arr[3] / exists[3], 1)for i in range(5):if not exists[i]:arr[i] = 'N'return arrif __name__ == '__main__':input_nums = list(map(lambda x: eval(x), (input()).split()))result = class_numbers(input_nums[1:])print('%s %s %s %s %s' % (result[0], result[1], result[2], result[3], result[4]))