qyliang/CodeNanoFix huggingface dataset:
Buggy code:
#encoding utf-8
from operator import itemgetter


n,t = map(int, input().split())

ct = []
for i in range(n):
    c_0,t_0 = map(int, input().split())
    ct.append([c_0,t_0])

ct0 = list(ct)
ct.sort(key=itemgetter(1))
# print(ct)
# print(ct0)
if ct[0][1] <= t:
    for i in range(len(ct0)):
        if ct[0] == ct0[i]:
            print(int(i)+1)
else:
    print("TLE")


Fixed code:
#encoding utf-8
from operator import itemgetter


n,t = map(int, input().split())

ct = []
for i in range(n):
    c_0,t_0 = map(int, input().split())
    ct.append([c_0,t_0])

time_flag = 0
for i in range(len(ct)):
    if ct[i][1] <= t:
        time_flag += 1
    else:
        ct[i][0] = 1001

ct0=list(ct)
ct.sort(key=itemgetter(0))
# print(ct)

if time_flag == 0:
    print("TLE")
else:
    print(ct[0][0])
Buggy code:
n,T=map(int,input().split())
data=[input().split() for i in range(n)]
lc=[]
for row in data:
    if int(row[1]) <=T:
        lc.append(row[0])
if not lc:
    print("TLE")
else:
    print(min(lc))

Fixed code:
n,T=map(int,input().split())
data=[input().split() for i in range(n)]
lc=[]
for row in data:
    if int(row[1]) <=T:
        lc.append(row[0])
ls=[int(j) for j in lc]

if not lc:
    print("TLE")
else:
    print(min(ls))
Buggy code:
N, T = map(int, input().split())
List = []
List2 = []
min = 1000

for i in range(N):
    M, B = map(int, input().split())
    List.append([M,B])
    M, B = 0, 0

for k in range(N):
    if int(List[k][1]) <= T:
        List2.append(List[k])

for n in range(len(List2)):
    if List2[n][0] <= min:
        min = List[n][0]

if min == 1001:
    print('TLE')
else:
    print(min)

Fixed code:
N, T = map(int, input().split())
List = []
List2 = []
min = 1001

for i in range(N):
    M, B = map(int, input().split())
    List.append([M,B])
    M, B = 0, 0

for k in range(N):
    if int(List[k][1]) <= T:
        List2.append(List[k])

for n in range(len(List2)):
    if List2[n][0] <= min:
        min = List2[n][0]

if min == 1001:
    print('TLE')
else:
    print(min)
Buggy code:
N,T=map(int,input())
ans=100000000
for i in range(n):
  c,t=map(int,input().split())
  if t>T: continue
  ans=min(c,ans)
print(ans if ans<100000000 else 'TLE')

Fixed code:
N,T=map(int,input().split())
ans=100000000
for i in range(N):
  c,t=map(int,input().split())
  if t>T: continue
  ans=min(c,ans)
print(ans if ans<100000000 else 'TLE')
Buggy code:
N,T = map(int,input().split())
li = []
for i in range(N):
    c,t = map(int,input().split())
    if t > T:
        continue
    else:
        li.append(c)
print(min(li))

Fixed code:
N,T = map(int,input().split())
li = []
for i in range(N):
    c,t = map(int,input().split())
    if t > T:
        continue
    else:
        li.append(c)
if li == []:
    print("TLE")
else:
    print(min(li))
Buggy code:
n,t=map(int, input().split())
l=[input().split() for i in range(n)]

k=[]

for x in range(n):
  if (int(l[x][1])<t):
    k.append(l[x][0])
    
print(min(k))

Fixed code:
n,t=map(int, input().split())
l=[input().split() for i in range(n)]

k=[]

for x in range(n):
  if (int(l[x][1]) <= t):
    k.append(int(l[x][0]))
  
if (k==[]):
  print('TLE')
else:  
  print(min(k))
Buggy code:
x,y = map(int,input().split())

cost = 1001

for i in range(x):
    a,b = map(int, input().split())
    if b <= y:
        cost = min(cost,x)

print("TLE" if cost==1001 else cost)

Fixed code:
x,y = map(int,input().split())

cost = 1001

for i in range(x):
    a,b = map(int, input().split())
    if b <= y:
        cost = min(cost,a)

print("TLE" if cost==1001 else cost)
Buggy code:
N, T = map(int, input().split())
min_c = 1001
for n in range(N):
    c, t = map(int, input().split())
    if t <= T:
        min_c = min(min_c, c)

if min_c == 1001:
    print(min_c)
else:
    print('TLE')

Fixed code:
N, T = map(int, input().split())
min_c = 1001
for n in range(N):
    c, t = map(int, input().split())
    if t <= T:
        min_c = min(min_c, c)

if min_c != 1001:
    print(min_c)
else:
    print('TLE')
Buggy code:
N,T=map(int,input().split())
List = []
for i in range (N):
  List.append(list(map(int, input().split())))
res = 1001
for i in range(N):
  if List[i][1] < T:
    res = min(res,List[i][0])
print(res)

Fixed code:
N,T=map(int,input().split())
List = []
for i in range (N):
  List.append(list(map(int, input().split())))
res = 1001
for i in range(N):
  if List[i][1] <= T:
    res = min(res,List[i][0])
if res == 1001:
  print("TLE")
else:
  print(res)
Buggy code:
n,a=map(int,input().split())
ans=100000000
for i in range(n):
  c,t=map(int,input().split())
  if t<=a:
    ans=min(ans,c)
if ans=100000000
  print('TLE')
else:
  print(ans)


Fixed code:
n,a=map(int,input().split())
ans=100000000
for i in range(n):
  c,t=map(int,input().split())
  if t<=a:
    ans=min(ans,c)
if ans==100000000:
  print('TLE')
else:
  print(ans)
Buggy code:
# -*- coding : utf-8 -*-
N, T = map(int, input().split(" "))

c = [int(1001)]

for i in range(0, N):
    tmp, t = map(int, input().split(" "))
    if t <= T:
        c.append(tmp)

tmp = min(c)

if tmp == 1001:
    print("TEL")
else:
    print(tmp)

Fixed code:
# -*- coding : utf-8 -*-
N, T = map(int, input().split(" "))

c = [int(1001)]

for i in range(0, N):
    tmp, t = map(int, input().split(" "))
    if t <= T:
        c.append(tmp)

tmp = min(c)
if tmp == 1001:
    print("TLE")
else:
    print(tmp)
Buggy code:
n,T = map(int, input().split())
i = 1001
 
for _ in range(N):
  c, t = map(int, input().split())
  if t <= T:
    i = min(i, c)

if i == 1001:
  print('TLE')
else:
  print(i)

Fixed code:
N, T = map(int, input().split())
i = 1001
 
for _ in range(N):
  c, t = map(int, input().split())
  if t <= T:
    i = min(i, c)

if i == 1001:
  print('TLE')
else:
  print(i)
Buggy code:

N,T=input().split(' ')
N=int(N)
T=int(T)
a=list()
for i in range(N):
    c,t=input().split(' ')
    c=int(c)
    t=int(t)
    a.append((c,t))

minValue=0x3FF
print(minValue)
for it in a:
    if it[1]>T:
        continue
    if it[0]<minValue:
        minValue=it[0]
if(minValue==0x3FF):
    print("TLE")
else:
    print(minValue)



Fixed code:

N,T=input().split(' ')
N=int(N)
T=int(T)
a=list()
for i in range(N):
    c,t=input().split(' ')
    c=int(c)
    t=int(t)
    a.append((c,t))

minValue=0x3FF

for it in a:
    if it[1]>T:
        continue
    if it[0]<minValue:
        minValue=it[0]
if(minValue==0x3FF):
    print("TLE")
else:
    print(minValue)
Buggy code:
def input_N_T():
    N_T=input().split()
    int_N_T=list(map(int,N_T))
    N=int_N_T[0]
    T=int_N_T[1]
    return [N,T]

N,T=input_N_T()

min_c,min_t=1001,1001

for i in range(N):
    c,t=input_N_T()
    if(t<=T and min(min_c,c)==c):
        min_c,min_t=c,t

print(c)

Fixed code:
def input_N_T():
    N_T=input().split()
    int_N_T=list(map(int,N_T))
    N=int_N_T[0]
    T=int_N_T[1]
    return [N,T]

N,T=input_N_T()

min_c,min_t=1001,1001

for i in range(N):
    c,t=input_N_T()
    if(t<=T and min(min_c,c)==c):
        min_c=c

if(min_c==1001):
    print("TLE")
    
else:
    print(min_c)
Buggy code:
N,T=map(int,input().split())
ls=[int(input()) for _ in range(N)]
ans=10**18
for i in ls:
  if i[0] <= T:
    ans = min(ans,i[1])
if ans < 10**18:
  print(ans)
else:
  print('TLE')


Fixed code:
N,T=map(int,input().split())
ls=[list(map(int,input().split())) for _ in range(N)]
ans=10**18
for i in ls:
  if i[1] <= T:
    ans = min(ans,i[0])
if ans < 10**18:
  print(ans)
else:
  print('TLE')
Buggy code:
N, T = map(int, input().split())
ct = [[] for _ in range(N)]
for i in range(N):
    ct[i] = list(map(int, input().split()))
cost =[]
for v in ct:
    if v[1] <= T:
        cost.append(v)
for i, v in enumerate(cost):
    if i == 0:
        least = v[0]
    else:
        if v[0] <= least:
            least = v[0]
if least <= T:
    print(least)
else:
    print('TLE')

Fixed code:
N, T = map(int, input().split())
ct = [[] for _ in range(N)]
for i in range(N):
    ct[i] = list(map(int, input().split()))
cost =[]
for v in ct:
    if v[1] <= T:
        cost.append(v)
if len(cost) <1:
    print('TLE')
else:
    for i, v in enumerate(cost):
        if i == 0:
            least = v[0]
        else:
            if v[0] <= least:
                least = v[0]
    print(least)
Buggy code:
#coding:utf-8
min_t = 10000
n,T = list(map(int,input().split()))
for i in range(n):
    c,t = list(map(int,input().split()))
    if t < min_t:
        min_t = t
        min_c = c
if min_t<=T:
    print (c)
else:
    print ('TLE')


Fixed code:
#coding:utf-8
min_c = 10000
n,T = list(map(int,input().split()))
for i in range(n):
    c,t = list(map(int,input().split()))
    if t <= T and c < min_c:
        min_c = c
if min_c!=10000:
    print (min_c)
else:
    print ('TLE')
Buggy code:
n, limit = map(int, input().split())
cost = list()
for _ in range(n):
  c, time = [int(a) for a in input().split()]
  if time <= limit:
    cost.append(c)
print(max(cost) if len(cost) > 0 else 'TLE')


Fixed code:
n, limit = map(int, input().split())
cost = list()
for _ in range(n):
  c, time = [int(a) for a in input().split()]
  if time <= limit:
    cost.append(c)
print(min(cost) if len(cost) > 0 else 'TLE')
Buggy code:
N,T = list(map(int,input().split()))
C = [list(map(int,input().split())) for i in range(N)]
C = sorted(C, key = lambda x : x[1],reverse =False)

A =[0]
for i in C:
    if i[1] < T:
        A.append(i[0])

print(min(A) if min(A) != 0 else "TLE")

Fixed code:
N,T = list(map(int,input().split()))
C = [list(map(int,input().split())) for i in range(N)]
C = sorted(C, key = lambda x : x[1],reverse =False)
#print(C)

A =[1001]
for i in C:
    if i[1] <= T:
        A.append(i[0])

print(min(A) if min(A) != 1001 else "TLE")
Buggy code:
N,T = map(int, input().split(" "))

way = []

for i in range(N):
  c,t = map(int, input().split(" "))
  if T >= t:
    way.append([c])
  
if len(way) == 0:
  print("TLE")
else:
  way.sort()
  print(way[0])

Fixed code:
N,T = map(int, input().split(" "))

way = []

for i in range(N):
  c,t = map(int, input().split(" "))
  if T >= t:
    way.append(c)
  
if len(way) == 0:
  print("TLE")
else:
  way.sort()
  print(way[0])
Buggy code:
N,T=map(int,input().split())

CT=[[0,0]]*N
i=0
while i<N:
    CT[i]=map(int,input().split())
    i+=1

ans='TLE'
for x,y in CT:
    if y<=T:
        ans=x
print(ans)


Fixed code:
N,T=map(int,input().split())

CT=[[0,0]]*N
i=0
while i<N:
    CT[i]=list(map(int,input().split()))
    i+=1

CT=sorted(CT)

ans='TLE'
for x,y in CT:
    if y<=T:
        ans=x
        break
print(ans)
Buggy code:
N, T = map(int, input().split())

r = 1001
for _ in range(N):
  c, t = map(int, input().split())
  if t < T:
    r = min(c, r)
print (r if r<1001 else "TLE")

Fixed code:
N, T = map(int, input().split())

r = 1001
for _ in range(N):
  c, t = map(int, input().split())
  if t <= T:
    r = min(c, r)
print (r if r<1001 else "TLE")
Buggy code:
# N T
# c1 t1
N, T = map(int, input().split())
c_min = 1001
for _ in range(N):
    c, t = map(int, input().split())
    if c < c_min and t < T:
        c_min = c
if c_min == 1001:
    print('TLE')
else:
    print(c_min)

Fixed code:
# N T
# c1 t1
N, T = map(int, input().split())
c_min = 1001
for _ in range(N):
    c, t = map(int, input().split())
    if c < c_min and t <= T:
        c_min = c
if c_min == 1001:
    print('TLE')
else:
    print(c_min)
Buggy code:
n, t = map(int, input().split())
c = [input().split() for _ in range(n)]
c_sorted = sorted(c, key=lambda i:i[1])
print(c_sorted[0][0] if int(c_sorted[0][1]) <= t else 'TLE')

Fixed code:
n, t = map(int, input().split())
c = [input().split() for _ in range(n)]
c_sorted = sorted(c, key=lambda i:int(i[0]))
for i in range(n):
    if int(c_sorted[i][1]) <= t:
        print(c_sorted[i][0])
        exit()
    else:
        pass
print('TLE')
Buggy code:

lst_1 = input().split()

N = int(lst_1[0])
T = int(lst_1[1])

ans = "TLE"
cost_min = 9999

lst_A = []

for i in range(N):

    lst_A.append(input().split())

for i in range(N):

    if (int(lst_A[i][0]) < cost_min) and (int(lst_A[i][0]) <= T):
        ans = lst_A[i][0]

print(ans)

Fixed code:

lst_1 = input().split()

N = int(lst_1[0])
T = int(lst_1[1])

ans = "TLE"
cost_min = 9999

lst_A = []

for i in range(N):

    lst_A.append(input().split())

for i in range(N):

    if (int(lst_A[i][0]) < cost_min) and (int(lst_A[i][1]) <= T):
        cost_min = int(lst_A[i][0])
        ans = int(lst_A[i][0])

print(ans)
Buggy code:
N, T = map(int, input().split())

cost = [list(map(int, input().split())) for i in range(N)]

ans = []

for c in cost:
  if c[1] < T+1:
    ans.append(c)
    
if ans != []:
  ans = sorted(ans, key=lambda x: x[1])
  print(ans[0][0])
else:
  print("TLE")

Fixed code:
N, T = map(int, input().split())

cost = [list(map(int, input().split())) for i in range(N)]

ans = []

for c in cost:
  if c[1] < T+1:
    ans.append(c)
    
if ans != []:
  ans = sorted(ans, key=lambda x: x[0])
  print(ans[0][0])
else:
  print("TLE")
Buggy code:
N, T = map(int, input().split())

ct = [int(j) for j in input().split() for i in range(H)]

ct.sort(key=lambda x: x[0])

ans = 1001

for i in range(N):
    if ct[i][1] <= T:
        ans = ct[i][0]
        break

print("TLE" if ans == 1001 else ans)


Fixed code:
N, T = map(int, input().split())

ct = [[int(j) for j in input().split()] for i in range(N)]

ct.sort(key=lambda x: x[0])

ans = 1001

for i in range(N):
    if ct[i][1] <= T:
        ans = ct[i][0]
        break

print("TLE" if ans == 1001 else ans)
Buggy code:
def main():
    N,T= (int(i) for i in input().split())
    a_min=1000

    for i in range(N):
        ai,bi= (int(j) for j in input().split())  
        if bi<= T:
            if ai <= a_min:
                a_min = ai

    if ai==1000:
        print("TLE")
    else:
        print(a_min)
          
     
main()

Fixed code:
def main():
    N,T= (int(i) for i in input().split())
    a_min=1001

    for i in range(N):
        ai,bi= (int(j) for j in input().split())  
        if bi<= T:
            if ai <= a_min:
                a_min = ai

    if a_min==1001:
        print("TLE")
    else:
        print(a_min)
          
     
main()
Buggy code:
n,T= map(int,input().split())
min = 1000
for i in range(n):
    c,t = map(int,input().split())
    if T > t and min > c:
        min = c
if min ==1000:
    print('TLE')
else:
    print(min)

Fixed code:
n,T= map(int,input().split())
min = 1001
for i in range(n):
    c,t = map(int,input().split())
    if T >= t and min > c:
        min = c
if min > 1000:
    print('TLE')
else:
    print(min)
Buggy code:
N,T=map(int,input().split())
res=2000
for i in N:
  c,t=map(int,input())
  if t>T:
    continue
  else:
    res=min(res,c)
if res=2000:
  print("TLE")
else:
  print(res)

Fixed code:
N,T=map(int,input().split())
res=2000
for i in range(N):
  c,t=map(int,input().split())
  if t>T:
    continue
  else:
    res=min(res,c)
if res==2000:
  print("TLE")
else:
  print(res)
Buggy code:
n, t = map(int, input().split())
k = [list(map(int, input().split())) for _ in range(n)]
a = [item[0] for item in k if item[1] <= t]
if k:
  print(min(k))
else:
  print("TLE")

Fixed code:
n, t = map(int, input().split())
k = [list(map(int, input().split())) for _ in range(n)]
a = [item[0] for item in k if item[1] <= t]
if a:
  print(min(a))
else:
  print("TLE")
Buggy code:
N,T = map(int,input().split())
c = [0] * N
t = [0] * N
for i in range(N):
    c[i],t[i] = map(int,input().split())
    
ans = 1001
for i in range(N):
    if t[i] < T:
        if c[i] < ans:
            ans = c[i]
            
if ans == 1001:
    print('TLE')
else:
    print(ans)

Fixed code:
N,T = map(int,input().split())
c = [0] * N
t = [0] * N
for i in range(N):
    c[i],t[i] = map(int,input().split())
    
ans = 1001
for i in range(N):
    if t[i] <= T:
        if c[i] < ans:
            ans = c[i]
            
if ans == 1001:
    print('TLE')
else:
    print(ans)
Buggy code:
[N, T] = [int(i) for i in input().split()]
cmin = 1001
for i in range(N):
    [c, t] = [int(i) for i in input().split()]
    if t <= T and c <= cmin:
        cmin = c
if cmin == 1001:
    print('TLE')
else:
    print(c)

Fixed code:
[N, T] = [int(i) for i in input().split()]
cmin = 1001
for _ in range(N):
    [c, t] = [int(i) for i in input().split()]
    if t <= T and c <= cmin:
        cmin = c
if cmin == 1001:
    print('TLE')
else:
    print(cmin)
Buggy code:
n, t = map(int, input().split())
a = [list(map(int, input().split())) for i in range(n)]
l = []
flag = False
for i in range(n):
    if a[i][2] <= t:
        l.append(a[i][0])
        flag = True
if flag:
    print(min(l))
else:
    print('TLE')

Fixed code:
n, t = map(int, input().split())
a = [list(map(int, input().split())) for i in range(n)]
l = []
flag = False
for i in range(n):
    if a[i][1] <= t:
        l.append(a[i][0])
        flag = True
if flag:
    print(min(l))
else:
    print('TLE')
Buggy code:
N, T = map(int, input().split())
min_c = 1001
for _ in range(N):
    c, t = map(int, input().split())
    if t <= T and c < min_c:
        min_c = c
print('TLE' if min_c == 1000 else min_c)

Fixed code:
N, T = map(int, input().split())
min_c = 1001
for _ in range(N):
    c, t = map(int, input().split())
    if t <= T and c < min_c:
        min_c = c
print('TLE' if min_c == 1001 else min_c)
Buggy code:
N, T = map(int, input().split())
ct = [None] * N
for i in range(N):
  ct[i] = list(map(int, input().split()))
ct = sorted([x[0] for x in ct if x[1] <= T]) + ['LTE']
print(ct[0])

Fixed code:
N, T = map(int, input().split())
ct = [None] * N
for i in range(N):
  ct[i] = list(map(int, input().split()))
ct = sorted([x[0] for x in ct if x[1] <= T]) + ['TLE']
print(ct[0])
Buggy code:
N, T = map(int, input().split())
ct = [None] * N
for i in range(N):
  ct[i] = list(map(int, input().split()))
ct = list(filter(lambda x: x[1] <= T, ct))
if not len(ct) > 0:
  ct.append([0, 'TLE'])
ct = sorted(ct, key=lambda x: x[0])
print(ct[0][1])


Fixed code:
N, T = map(int, input().split())
ct = [None] * N
for i in range(N):
  ct[i] = list(map(int, input().split()))
ct = list(filter(lambda x: x[1] <= T, ct))
if not len(ct) > 0:
  ct.append(['TLE', 0])
ct = sorted(ct, key=lambda x: x[0])
print(ct[0][0])
Buggy code:
N,T=map(int,input().split())
l=[]
for i in range(N):
    c,t=map(int,input().split())
    if t < T:
        l.append(c)
if l =[]:
    print("TLE")
elif:
    print(min(l))

Fixed code:
N,T=map(int,input().split())
l=[]
for i in range(N):
    c,t=map(int,input().split())
    if t <= T:
        l.append(c)
if not l:
    print("TLE")
else:
    print(min(l))
Buggy code:
n, T = map(int, input.split())
res = 2000
for _ in range(n):
  c, t = map(int, input.split())
  if t > T: continue
  res = min(res, c)
if res == 2000:
  print('TLE')
else:
  print(res)

Fixed code:
n, T = map(int, input().split())
res = 2000
for _ in range(n):
  c, t = map(int, input().split())
  if t > T: continue
  res = min(res, c)
if res == 2000:
  print('TLE')
else:
  print(res)
Buggy code:
N,T=map(int,input().split())
k=1000
l=1
for i in range(N):
    c,t = int(input())
    if t[i] <= T:
        l=0
        if c[i] < k:
            k = c[i]
if l==1:
    print('TLE')
else:
    print(k)

Fixed code:
N,T=map(int,input().split())
k=1000
l=1
for i in range(N):
    c,t=map(int,input().split())
    if t <= T:
        l=0
        if c < k:
            k = c
if l==1:
    print('TLE')
else:
    print(k)
Buggy code:
N,T = map(int,input().split())
mn = 10**10
for i in range(N):
    c,t = map(int,input().split())
    if t <= T and c < mn:
        mn = c
if mn == 10**10:
    print("TLE")
else:
    print(c)


Fixed code:
N,T = map(int,input().split())
mn = 10**10
for i in range(N):
    c,t = map(int,input().split())
    #print(c,t)
    if t <= T and c <= mn:
        mn = c
if mn == 10**10:
    print("TLE")
else:
    print(mn)
Buggy code:
N, T = map(int, input().split())

Array = [list(map(int, input().split())) for _ in range(N)]

# print(Array)

Array.sort(key=lambda x:x[0])

# print(Array)
# print(Array[0][0])

# Array.sort(key=lambda x:x[1])
#
# print(Array)

for i in range(N):
    if Array[i][1] < T:
        print(Array[i][0])
        break
else:
  print('TLE')


Fixed code:
N, T = map(int, input().split())

Array = [list(map(int, input().split())) for _ in range(N)]

# print(Array)

Array.sort(key=lambda x:x[0])

# print(Array)
# print(Array[0][0])

# Array.sort(key=lambda x:x[1])
#
# print(Array)

for i in range(N):
    if Array[i][1] <= T:
        print(Array[i][0])
        break
else:
  print('TLE')
Buggy code:
N,T = map(int,input().split())
m = 1001
for i in range(N) :
    c,t = map( int, input().split() )
    if t<=m:
        m = min(m,c)
    print('TLF' if m==1001 else m)

Fixed code:
N,T = map(int,input().split())
m = 1001
for i in range(N) :
    c,t = map( int, input().split() )
    if t<=T:
        m = min(m,c)
print('TLE' if m==1001 else m)
Buggy code:
""" AtCoder """

import sys
input = sys.stdin.readline

N, T = map(int, input().split())

min_c = 1001

for _ in range(N):
    c, t = map(int, input().split())
    if t < T and c < min_c:
        min_c = c

if min_c == 1001:
    print("TLE")
else:
    print(min_c)


Fixed code:
""" AtCoder """

import sys
input = sys.stdin.readline

N, T = map(int, input().split())

min_c = 1001

for _ in range(N):
    c, t = map(int, input().split())
    if t <= T and c < min_c:
        min_c = c

if min_c == 1001:
    print("TLE")
else:
    print(min_c)
Buggy code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**13
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    n,t = LI()
    a = [LI() for _ in range(n)]
    r = inf
    for c, d in a:
        if d > t:
            continue
        if r > c:
            r = c
    if r == inf:
        return -1

    return r


print(main())


Fixed code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**13
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    n,t = LI()
    a = [LI() for _ in range(n)]
    r = inf
    for c, d in a:
        if d > t:
            continue
        if r > c:
            r = c
    if r == inf:
        return 'TLE'

    return r


print(main())
Buggy code:
n, t_l = map(int, input().split())
for i in range(n):
    c, t = map(int, input().split())
cost = []
for i in range(n):
    if t <= t_l:
        cost.append(c)
if cost == []:
    print("TLE")
else:
    print(min(cost))

Fixed code:
n, t_l = map(int, input().split())
cost = []
for i in range(n):
    c, t = map(int, input().split())
    if t <= t_l:
        cost.append(c)
if cost == []:
    print("TLE")
else:
    print(min(cost))
Buggy code:
n, t = map(int, input().split())
ans = float('inf')
for _ in range(n):
    x, y = map(int, input().split())
    if y <= t:
        ans = min(ans, x)
print(ans)

Fixed code:
n, t = map(int, input().split())
ans = float('inf')
for _ in range(n):
    x, y = map(int, input().split())
    if y <= t:
        ans = min(ans, x)
if ans == float('inf'):
    print('TLE')
else:
    print(ans)