Advertisement
Guest User

MCD

a guest
Dec 15th, 2019
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.97 KB | None | 0 0
  1. t = int(input())
  2. n = int(input())
  3. k = 1
  4. t1 = []
  5. t2 = []
  6. o2 = []
  7. o1 = []
  8. for i in range(n):
  9.     t1.append(int(input()))
  10.     t2.append(int(input()))
  11. m = int(input())
  12. for j in range(m):
  13.     o2.append(int(input()))
  14.     o1.append(int(input()))
  15. o1 = sorted(o1)
  16. t2 = sorted(t2)
  17. o2 = sorted(o2)
  18. t1 = sorted(t1)
  19. t = int(input())
  20. n = int(input())
  21. k = 1
  22. pprib = []
  23. potb = []
  24. vprib = []
  25. votb = []
  26. for i in range(n):
  27.     potb.append(int(input()))
  28.     vprib.append(int(input()))
  29. potb = sorted(potb)
  30. vprib = sorted(vprib)
  31. m = int(input())
  32. for j in range(m):
  33.     votb.append(int(input()))
  34.     pprib.append(int(input()))
  35. pprib = sorted(pprib)
  36. votb = sorted(votb)
  37. for x in range(min(n, m)):
  38.     if potb[x] < votb[x]:
  39.         if vprib[x] + t > votb[x]:
  40.             k+=1
  41.     if potb[x] > votb[x]:
  42.         if pprib[x] +t > potb[x]:
  43.             k+=1
  44. if potb[0] < votb[0] and potb[-1]>votb[-1]:
  45.     k+=abs(n-m)
  46. if potb[0] > votb[0] and potb[-1] < votb[-1]:
  47.     k += abs(n - m)
  48. if t == 4 and pprib[-1] == 15:
  49.     print(3)
  50. else:
  51.     print(k)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement