import sys n = int(input()) l = list() #用list(tuple,tuple)存储 res = dict() #用dic存index for i in range(n): index, value = input().split(' ') l.append((int(index), int(value))) res[int(index)] = 0 # 更新dic的value for item in l: res[item[0]] = res[item[0]] + item[1] # 根据字典的key排序 res =...