ha, ta, hb, tb, h, t = [], [], [], [], [], [] #分别存储A城温度、截止时间,B城温度、持续时间、温差、持续时间 ha = list((map(int, input().split(",")))) ta = list((map(int, input().split(",")))) hb = list((map(int, input().split(",")))) tb = list((map(int, input().split(",")))) na = len(ha) nb = len(hb) h = [0] * max(na, nb) t = [0] * max(na, nb) for i in range(1, nb): __________ #转换为截止时间 p0 = i = j = 0 n = -1 while i < na and j < nb: diff = ha[i] - hb[j] p1 = ta[i] if __________: i += 1 if p1 >= tb[j]: p1 = tb[j] j += 1 if n == -1 or diff != h[n]: n += 1 h[n] = diff t[n] = p1 - p0 else: __________ p0 = p1 for i in range(n + 1): print(h[i], t[i])