Advertisement
Pearlfromsu

Untitled

Sep 30th, 2021
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. using System;
  2. class HelloWorld
  3. {
  4. static void Main()
  5. {
  6. int sum = 0, n = int.Parse(Console.ReadLine()), mindif = int.MaxValue;
  7. for (int i = 0; i < n; i++) {
  8. int now = int.Parse(Console.ReadLine());
  9. sum += now;
  10. if (now < mindif && now % 4 != 0)
  11. mindif = now;
  12. }
  13. Console.WriteLine((sum % 4 == 0) ? ((mindif != int.MaxValue) ? ((n - 1) + " " + (sum - mindif)) : "0") : (n + " " + sum));
  14. Console.ReadKey();
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement