Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Num1 = int(input())
- Color1 = list(map(int, input().split()))
- Num2 = int(input())
- Color2 = list(map(int, input().split()))
- i = 0
- j = 0
- S = [Color1[i], Color2[j]]
- while i < len(Color1) and j < len(Color2):
- if abs(S[1] - S[0]) > abs(Color1[i] - Color2[j]):
- S = [Color1[i], Color2[j]]
- if Color1[i] < Color2[j]:
- i += 1
- else:
- j += 1
- print(*S)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement