Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //fpc 3.0.0
- var cur,cnt_odd,cnt_even,cnt_odd3,cnt_even3,i,n:integer;
- begin
- readln(n);
- cnt_even := 0;
- cnt_odd := 0;
- cnt_even3 := 0;
- cnt_odd3 := 0;
- for i := 1 to n do begin
- readln(cur);
- if cur mod 2 = 0 then inc(cnt_even)
- else inc(cnt_odd);
- if cur mod 6 = 0 then inc(cnt_even3);
- if cur mod 6 = 3 then inc(cnt_odd3);
- end;
- writeln(cnt_odd * cnt_even3 + cnt_odd3 * cnt_even - cnt_even3 * cnt_odd3);
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement