import java.util.*; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int num = in.nextInt(); Map<Integer, Integer> map = new HashMap<>(); for (int i = 0; i < num; i++) { Integer key = in.nextInt(); Integer value = in.nextInt(); // 判断是否已...