Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- l=int(input())
- for i in range(l):
- m=list(map(int, input().split()))
- x=m[0]
- y=m[1]
- k=m[2]
- n=m[3]
- req = x-y
- maxi = 0
- for j in range(n):
- z=list(map(int, input().split()))
- if (z[1]<=k):
- maxi= max(maxi,z[0])
- if req <= maxi:
- print("Fortunate")
- else:
- print("Unfortunate")
Advertisement
Add Comment
Please, Sign In to add comment