runtime error - nzec python 3.5

It’s a simple and straightforward problem but i’m ending getting runtime error-nzec. Please tell me wherre am i making a mistake and suggestions to sort this out.(I’ve spent a lot of time but couldn’t figure out the mistake) Thanks in Advance!

t=int(input())
res=[]
for j in range(t):
    x,y,k,n=map(int,input().split())
    
    if(x<=y):
        res.append("LuckyChef")
    else:
        res.append("UnluckyChef")
        for _ in range(n):
            p,c=map(int, input().split())
            if c<=k:
                if p>=x-y:
                    res[j]='LuckyChef'
                    break

for x in res:
    print(x)

Your approach is correct, but you must take the complete input of a test case before moving onto the next test case. Example case
2 1 1 1 1 100 100 2 1 10 1 20 20

In the first case your (x<=y) is satisfied. In the next test case you are attempting to unpack the line “100 100” into x,y,k,n instead of “2 1 10 1”. This causes a runtime error.