Help me in solving IMDB problem

My issue

My code

# cook your dish here
t=int(input())
for i in range(t):
    n,x=map(int,input().split())
    h=0
    for i in range(n):
        s,r=map(int,input().split())
        if s<=x:
            if(r>h):
                h=r
    print(r)

Problem Link: CodeChef: Practical coding for everyone

@srgec703
U have to print h not r.

1 Like