n = int(input())
data = []
result = []
for i in range(n):
parts = input().split(' ')
name = parts[0]
yw = int(parts[1])
sx = int(parts[2])
yy = int(parts[3])
zf = yw+sx+yy
result.append([name,yw,sx,yy,zf])
for i in range(len(result)):
for j in range(i+1,len(result)):
if (abs(result[i][1]-result[j][1])<=5 and abs(result[i][2]-result[j][2])<=5
and abs(result[i][3]-result[j][3])<=5 and abs(result[i][4]-result[j][4])<=10
and result[i][0]!=result[j][0]):
data.append([result[i][0],result[j][0]])
for i in data:
print(f'{i[0]} {i[1]}')
洛谷_P5741【深基7.例10】旗鼓相当的对手 - 加强版_python写法
于 2024-02-13 22:49:26 首次发布