Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class F_OJogoDoHenrique {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- long even1 = 0;
- long odd1 = 0;
- long even2 = 0;
- long odd2 = 0;
- int max1 = scanner.nextInt();
- for (int i = 0; i < max1; i++) {
- if (scanner.nextInt() % 2 == 0) even1++;
- else odd1++;
- }
- int max2 = scanner.nextInt();
- for (int i = 0; i < max2; i++) {
- if (scanner.nextInt() % 2 == 0) even2++;
- else odd2++;
- }
- System.out.println((even1 * even2 + odd1 * odd2) + " " + (even1 * odd2 + even2 * odd1));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement