The input of the program is a sequence of N
natural numbers. You need to choose an arbitrary number of numbers from them so that their sum is maximum and not divisible by 4.
As a result, the program should display the number of selected numbers and their sum. If it is impossible to get the required amount, 0 should be returned as an answer.
Input
The input to the program is a natural number N
(\(N <= 1000\)), and then N< /code> natural numbers, each of which does not exceed 10000.
Output
The program should output two numbers: first, the number of selected numbers, and then their sum.
Examples
# |
Input |
Output |
1 |
3
1
2
1
|
2 3 |