Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- M, N, k = map(int, input().split(" ")) # number of workers
- m = list(map(int, input().split(" ")))
- n = list(map(int, input().split(" ")))
- maxworker = 0
- maxjobs = 0
- worker = 1
- for i in m:
- jobs = 0
- for j in n:
- if abs(i - j) > k:
- continue
- jobs += 1
- if jobs > maxjobs:
- maxworker = worker
- maxjobs = jobs
- worker += 1
- print(maxworker)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement