-->
当前位置:首页 > 题库

PROGRAMMING:Classification of integers

Luz5年前 (2021-05-10)题库380
Given n positive integers, you are required to get the following three calculation results:
-A1 = the largest integer divisible by 3
-A2 = the number of integers where there is an integer k that can be expressed as 3K + 1
-A3 = the average of all integers with integer k such that it can be expressed as 3K + 2 (accurate to 1 decimal place)
###Input format:
Input first gives a positive integer n in the first line, then n positive integers in the next line. All numbers should be no more than 100, and the numbers in the same row should be separated by spaces.
###Output format:
Output the values of A1, A2 and A3 in a row, separated by a space. If a number does not exist, the corresponding output is' none '.
###Input sample 1:
```in
eight
5 8 7 6 9 1 3 10
```
###Output sample 1:
```out
9 3 6.5
```
###Input example 2:
```in
eight
15 18 7 6 9 1 3 10
```
###Output example 2:
```out
18 3 NONE
```







answer:If there is no answer, please comment