Advertisement
Guest User

Untitled

a guest
May 24th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. //fpc 3.0.0
  2.  
  3.  
  4. var cur,cnt_odd,cnt_even,cnt_odd3,cnt_even3,i,n:integer;
  5. begin
  6. readln(n);
  7. cnt_even := 0;
  8. cnt_odd := 0;
  9. cnt_even3 := 0;
  10. cnt_odd3 := 0;
  11. for i := 1 to n do begin
  12. readln(cur);
  13. if cur mod 2 = 0 then inc(cnt_even)
  14. else inc(cnt_odd);
  15. if cur mod 6 = 0 then inc(cnt_even3);
  16. if cur mod 6 = 3 then inc(cnt_odd3);
  17. end;
  18. writeln(cnt_odd * cnt_even3 + cnt_odd3 * cnt_even - cnt_even3 * cnt_odd3);
  19. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement