import java.util.Arrays;import java.util.Comparator;import java.util.Scanner;public class BJ1931 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N=sc.nextInt(); int[][] arr = new int[N][2]; for(int i=0;i() { @Override public int compare(int[] o1, int[] o2) { if (o1[1] == o2[1]) { ..