fork download
  1. using System;
  2. using System.Linq;
  3.  
  4. class Program
  5. {
  6. static void Main()
  7. {
  8. int n = int.Parse(Console.ReadLine());
  9. var abc =
  10. (from _ in Enumerable.Range(0, 3)
  11. let arr = Console.ReadLine().Trim().Split(' ')
  12. select (from x in arr
  13. where int.Parse(x) % 3 != 0
  14. select x).Count()
  15. ).ToArray();
  16.  
  17. var ans = abc[0] * abc[1] * abc[2];
  18. Console.WriteLine(ans);
  19. }
  20. }
Success #stdin #stdout 0.03s 27900KB
stdin
3
3 2 9
6 10 12
3 6 1
stdout
1