Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class HelloWorld
- {
- static void Main()
- {
- int sum = 0, n = int.Parse(Console.ReadLine()), mindif = int.MaxValue;
- for (int i = 0; i < n; i++) {
- int now = int.Parse(Console.ReadLine());
- sum += now;
- if (now < mindif && now % 4 != 0)
- mindif = now;
- }
- Console.WriteLine((sum % 4 == 0) ? ((mindif != int.MaxValue) ? ((n - 1) + " " + (sum - mindif)) : "0") : (n + " " + sum));
- Console.ReadKey();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement