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.05s 27620KB
stdin
7
3 45 10 8 48 53 76
52 19 86 3 9 90 63
1 8 4 3 9 10 3
stdout
48