// 2019 IUSB Programming Competition // Round 1 Problem 5 // Give the hints for a Mastermind game // Solution by Liguo Yu import java.util.Scanner; public class round1_p5 { public static void main(String[] main) { Scanner scan = new Scanner(System.in); int a[] = new int[4]; int b[] = new int[4]; for (int i = 0; i < 4; i++) { a[i] = scan.nextInt(); } for (int i = 0; i < 4; i++) { b[i] = scan.nextInt(); } int x = 0; int y = 0; for (int i = 0; i < 4; i++) { if (a[i] == b[i]) x++; } for(int i = 0; i < 4; i++) { for(int j=0; j<4; j++) { if(i!=j && a[i] == b[j]) y++; } } System.out.println(x + " " + y); return; } }