Ledger Nano X - The secure hardware wallet
SHARE
TWEET

Untitled

a guest Apr 3rd, 2020 177 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class F_OJogoDoHenrique {
  4.  
  5.     public static void main(String[] args) {
  6.         Scanner scanner = new Scanner(System.in);
  7.         long even1 = 0;
  8.         long odd1 = 0;
  9.         long even2 = 0;
  10.         long odd2 = 0;
  11.  
  12.         int max1 = scanner.nextInt();
  13.         for (int i = 0; i < max1; i++) {
  14.             if (scanner.nextInt() % 2 == 0) even1++;
  15.             else odd1++;
  16.         }
  17.  
  18.         int max2 = scanner.nextInt();
  19.         for (int i = 0; i < max2; i++) {
  20.             if (scanner.nextInt() % 2 == 0) even2++;
  21.             else odd2++;
  22.         }
  23.  
  24.  
  25.         System.out.println((even1 * even2 + odd1 * odd2) + " " + (even1 * odd2 + even2 * odd1));
  26.     }
  27.  
  28. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top