import java.util.*; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int a = in.nextInt(); ArrayList<int[]> arrayList = new ArrayList<>(a); int[] k = new int[a]; for (int j = 0; j < a; j++) { ...