Problem:
 Score : 200 points    Problem Statement When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC.  You, the smartwatch, has found N routes to his home.  If Mr. X uses the i -th of these routes, he will get home in time t_i at cost c_i .  Find the smallest cost of a route that takes not longer than time T .      Constraints  All values in input are integers.  1 \leq N \leq 100  1 \leq T \leq 1000  1 \leq c_i \leq 1000  1 \leq t_i \leq 1000  The pairs (c_i, t_i) are distinct.         Input Input is given from Standard Input in the following format:  N  T  c_1  t_1  c_2  t_2  :  c_N  t_N       Output Print the smallest cost of a route that takes not longer than time T .  If there is no route that takes not longer than time T , print TLE instead.        Sample Input 1 3 70
7 60
1 80
4 50      Sample Output 1 4   The first route gets him home at cost 7 .  The second route takes longer than time T = 70 .  The third route gets him home at cost 4 .   Thus, the cost 4 of the third route is the minimum.       Sample Input 2 4 3
1 1000
2 4
3 1000
4 500      Sample Output 2 TLE  There is no route that takes not longer than time T = 3 .       Sample Input 3 5 9
25 8
5 9
4 10
1000 1000
6 1      Sample Output 3 5

Solution (Python):
n,t = map(int,input().split())
l = [list(map(int,input().split())) for i in range(n)]

res = float("inf")
flag = 0
for i in range(n):
    if l[i][1] <= t:
        if l[i][0] < res:
            res = l[i][0]
            flag = 1
if flag == 1:
    print(res)
else:
    print("TLE")

Solution (Python):
N, T = map(int, input().split())
lst = []
for i in range(0, N):
	c, t = map(int, input().split())
	if t <= T:
		lst.append(c)
if lst == []:
	print('TLE')
else:
	lst.sort()
	print(lst[0])

Solution (Python):
n,t = map(int,input().split())
ct = [list(map(int,input().split())) for i in range(n)]
c = 1001
for i in range(n):
  if ct[i][1] <= t:
    c = min(c,ct[i][0])
print(c) if c < 1001 else print('TLE')

Solution (Python):
n,t = map(int,input().split())
ct = [list(map(int,input().split())) for i in range(n)]
c = [1001]
for i in range(n):
  if ct[i][1] <= t:
    c = [min(c),ct[i][0]]
print(min(c)) if min(c) < 1001 else print('TLE')

Solution (Python):
n, t = map(int, input().split())
m = float("INF")
for i in range(n):
    cn, tn = map(int, input().split())
    if tn <= t:
        m = min(m, cn)
if m == float("INF"):
    print("TLE")
else:
    print(m)

Solution (Python):
n, t = map(int, input().split(" "))
c = [tuple(map(int, input().split(" "))) for i in range(n)]
c = [x for x in c if x[1] <= t]
if c:
    print(min(c)[0])
else:
    print("TLE")

Solution (Python):
N,T=map(int, input().split())
R=[999999999]
for i in range(N):
  c,t=map(int, input().split())
  if T>=t:
    R.append(c)
    
print('TLE' if len(R)==1 else min(R))

Solution (Python):
n,T=[int(i) for i in input().split()]
ans=[]
for i in range(n):
  c,t=[int(i) for i in input().split()]
  if t<=T:
    ans.append(c)
print(min(ans) if len(ans)!=0 else "TLE")

Solution (Python):
N,T=map(int,input().split())
lst=[]
for i in range(N):
  c,t=map(int,input().split())
  if t<=T:
    lst.append(c)
print("TLE" if len(lst)==0 else min(lst))

Solution (Python):
a, b = map(int, input().split())
c = []
for i in range(a):
    d, e = map(int, input().split())
    if e <= b:
        c.append([d, e])
c.sort()
print(c[0][0]if len(c) != 0 else "TLE")

Solution (Python):
from operator import itemgetter

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

ans = -1
ct.sort(key=itemgetter(1))
for i, c in enumerate(ct):
    if c[1] > T:
        break
    if i == 0:
        ans = c[0]
        continue
    ans = min(ans, c[0])

if ans == -1:
    print('TLE')
else:
    print(ans)

Solution (Python):
import sys
N, T = map(int, input().split())
ans=[]
limit=0
count=1
 
for _ in range(N):
    c, t = map(int, input().split())
    if T>=t:
        ans.append([count,c])
        count+=1
    else:
        limit+=1
        if limit==N:
            print('TLE')
            sys.exit()
    
    ans=sorted(ans,key=lambda x:x[1])
 
print(ans[0][1])

Solution (Python):
N, T = map(int, input().split())
ans=1001
for _ in range(N):
    c, t = map(int, input().split())
    if T>=t:
        ans=min(ans,c)

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

Solution (Python):
N,T = map(int,input().split())
ct = [list(map(int, input().split())) for _ in range(N)]
cr = []
for x in range(N):
  if T >= ct[x][1]:
    cr.append(ct[x][0])
print('TLE' if len(cr) == 0 else min(cr))

Solution (Python):
n,t=map(int,input().split())
ct=[list(map(int,input().split())) for i in range(n)]
cc=[i[0] for i in ct if i[1]<=t]
print('TLE' if len(cc)==0 else min(cc))

Solution (Python):
n, t = map(int, input().split())
l = [list(map(int, input().split())) for i in range(n)]
c = 1001
for i in range(n):
    if l[i][1] <= t:
        c = min(c, l[i][0])
if c == 1001:
    print('TLE')
else:
    print(c)

Solution (Python):
n, t = map(int, input().split())
ans = float("inf")

for i in range(n):
    nx, tx = map(int, input().split())
    if tx <= t:
        ans = min(ans, nx)

if ans == float("inf"):
    print("TLE")
else:
    print(ans)

Solution (Python):
N,T=map(int,input().split())
new=[]
for i in range(N):
  c,t=map(int,input().split())
  if t<=T:
    new.append(c)
if len(new) !=0:print(min(new))
else:print("TLE")

Solution (Python):
a = list(map(int,input().split()))
b = list(list(map(int,input().split())) for i in range(a[0]))
c = 1001

for i in range(a[0]):
  if b[i][1]<=a[1]:
    c = min(c,b[i][0])
else:
  if c==1001:
    print("TLE")
  else:
    print(c)

Solution (Python):
N, T = map(int,input().split())
min = 10000
result = "TLE"
for _ in range(N):
    c, t = map(int,input().split())
    if t <= T:
        if c < min:
            min = c
            result = c
print(result)

Solution (Python):



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

mi = float('inf')
for i in range(n):
    c,t = map(int,input().split())
    if t <= T:
        mi = min(mi,c)
if mi == float('inf'):
    print('TLE')
else:
    print(mi)

Solution (Python):
N, T = map(int, input().split())
data = [list(map(int, input().split())) for _ in range(N)]

import sys
from operator import itemgetter

data.sort(key=itemgetter(0))

for d in data:
	if d[1] <= T:
		print(d[0])
		sys.exit()

print('TLE')

Solution (Python):
N,T = map(int, input().split())
l = []
for i in range(N):
  c, t = map(int, input().split())
  if not t > T:
    l.append([i+1, c])
if l == []:
    print('TLE'); exit()
l.sort(key=lambda x: x[1])
print(l[0][1])

Solution (Python):
n, t = map(int, input().split())


choice = []

for i in range(n):
  cost, time = map(int, input().split())
  if time > t:
    pass
  else:
    choice.append(cost)
if len(choice) == 0:
  print('TLE')
else:
  print(min(choice))

Solution (Python):
n, t = map(int, input().split())
lst = [list(map(int, input().split())) for i in range(n)]

mn = 10**10
for i in range(n):
    if lst[i][1] <= t and mn > lst[i][0]:
        mn = min(mn, lst[i][0])

if mn == 10 ** 10:
    print("TLE")
else:
    print(mn)

Solution (Python):


N, T = map(int, input().split())
ct = [None] * N
for i in range(N):
    c, t = map(int, input().split())
    ct[i] = c, t

c_filtered = [c for (c, t) in ct if t <= T]

if c_filtered:
    ans = min(c_filtered)
else:
    ans = "TLE"

print(ans)

Solution (Python):
N,T = map(int,input().split())
ans = 1001
for i in range(N):
    c,t = map(int,input().split())
    if T >= t:
        ans = min(ans,c)
if ans == 1001:
    print("TLE")
else:
    print(ans)

Solution (Python):
from operator import itemgetter
n, t = list(map(int, input().split()))
ctl = [list(map(int, input().split())) for _ in range(n)]

ctl2 = [ct for ct in ctl if ct[1]<=t]
ctl2.sort(key=itemgetter(0))
if ctl2 == [] :
    print("TLE")
else :
    print(ctl2[0][0])

Solution (Python):
a, b = map(int, input().split())
c = []
for i in range(a):
    d, e = map(int, input().split())
    c.append([d, e])
c.sort()
for i in range(a):
    if c[i][1] <= b:
        print(c[i][0])
        exit()
print("TLE")

Solution (Python):

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

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


p = [i[0] for i in ls if i[1] <= t]
if p == []:
  print("TLE")
  quit()
print(min(p))

Solution (Python):
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")
else:
    print(min(l))

Solution (Python):
N, T = map(int, input().split())
ct = [list(map(int, input().split())) for _ in range(N)]
ans = 10**5
for c, t in ct:
    if t <= T:
        ans = min(ans, c)
print(ans) if ans != 10**5 else print("TLE")

Solution (Python):
n,t=map(int,input().split())
a=[]
for i in range(n):
  c,s=map(int,input().split())
  a.append([c,s])
a=sorted(a,key=lambda x:x[1])
z=1001
for i in range(n):
  if a[i][1]>t:
    break
  z=min(z,a[i][0])
print(z if z!=1001 else 'TLE')

Solution (Python):
N,T=map(int,input().split())
ct=[]
for _ in range(N):
    c,t=map(int,input().split())
    if t<=T:
        ct.append(c)

if ct==[]:
    print('TLE')
else:
    print(min(ct))

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

Solution (Python):
N,T = map(int,input().split())
paths = []
for i in range(N):
  cost, time = map(int,input().split())
  if time <= T:
    paths.append(cost)
if len(paths) == 0:
  print("TLE")
else:
  print(min(paths))

Solution (Python):





N, T = map(int, input().split())
C = []

for i in range(N):
    c, t = map(int, input().split())
    if t<=T:
        C.append(c)
ans=sorted(C)
if len(ans)>=1:
    print(ans[0])
else:
    print('TLE')

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

Solution (Python):
N,T = map(int, input().split())
ans = 1005
for i in range(N):
    c,t = map(int, input().split())
    if t <= T:
        ans = min(ans, c)
print("TLE" if ans == 1005 else ans)

Solution (Python):
n, t = map(int, input().split())
ct = []
for i in range(n):
    _c, _t = map(int, input().split())
    if _t <= t:
        ct.append([_c, _t])
if len(ct) == 0:
    print('TLE')
else:
    print(min(ct)[0])

Solution (Python):
import numpy as np

n, T = map(int, input().split())
c = np.zeros(n)
t = np.zeros(n)
for i in range(n):
    c_tmp, t_tmp = map(int, input().split())
    c[i] = (c_tmp)
    t[i] = (t_tmp)

tmp = c[t <= T]

if len(tmp) == 0:
    print("TLE")
else:
    print(int(min(tmp)))

Solution (Python):
N,T = list(map(int,input().split(" ")))
a = [list(map(int,input().split(" "))) for i in range(N)]

mini = 10000
for i,j in a:
    if j>T:
        continue
    else:
        
        mini = min(mini,i)

if mini==10000:
    print("TLE")
else:
    print(mini)

Solution (Python):
N,T =  list(map(int,(input().split())))

keiro = []
cost = []
for i in range(N):
  c,t =  list(map(int,(input().split())))
  if t<=T:
    keiro.append(t)
    cost.append(c)
  

if len(cost) >0 :
  print((min(cost)))
else:
  print('TLE')

Solution (Python):
n,T=map(int,input().split())
ct = []
for _ in range(n):
    c,t=map(int,input().split())
    ct.append([c,-(t<=T)])
ct = sorted(ct,key=lambda x:(x[1],x[0]))
print(ct[0][0] if ct[0][1] < 0 else 'TLE')

Solution (Python):
N, T = map(int, input().split())

min_c = 10000
for _ in range(N):
    c, t = map(int, input().split())

    if t <= T and c < min_c:
        min_c = c

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

Solution (Python):
N, T = map(int, input().split())

minc = 10000
for i in range(1, N+1):
	c, t = map(int, input().split())
	if t <= T and c < minc:
		minc = c

if minc == 10000:
	print('TLE')
else:
	print(minc)

Solution (Python):
n,t = map(int,input().split())
lst = [[int(i) for i in input().split()] for i in range(n)]

cst = 'TLE'
for i in range(n):
    if lst[i][1] <= t:
        if cst == 'TLE':
            cst = lst[i][0]
        elif lst[i][0] < cst:
            cst = lst[i][0]
print(cst)

Solution (Python):
n,t=map(int,input().split())
d = [list(map(int, input().split())) for i in range(n)]

ans = [d[i][0] for i in range(len(d)) if d[i][1] <= t]
if len(ans) == 0:
    print("TLE")
else:
    print(min(ans))

Solution (Python):
n,T=map(int, input().split())
c_l =[]
t_l=[]
for i in range(n):
    c,t=map(int,input().split())
    if t<=T:
        c_l.append(c)
        t_l.append(t)

if c_l == []:
    print("TLE")
else:
    print(min(c_l))

Solution (Python):
n,t = map(int,input().split())
a = []
for i in range(n):
    arr= list(map(int,input().split()))
    a.append(arr)
l = [i[0] for i in a if i[1]<=t]
if len(l)==0:print("TLE")
else:print(min(l))

Solution (Python):
N, T = [int(x) for x in input().split()]
min_c = 1001
for i in range(N):
  c, t = [int(x) for x in input().split()]
  if T >= t:
    min_c = min(min_c, c)
print(min_c if min_c < 1001 else 'TLE')

Solution (Python):
N, T = map(int, input().split())
List = [list(map(int, input().split())) for _ in range(N)]

arr = [List[i] for i in range(N) if List[i][1]<=T]

if arr==[]:
    print('TLE')
else:
    ans = min(arr, key=lambda x: x[0])[0]
    print(ans)

Solution (Python):
N,T = (int(i) for i in input().split())

cost = 10000
for i in range(N):
    c,t = (int(k) for k in input().split())
    if t <= T and c < cost:
        cost = c

if cost == 10000:
    print("TLE")
else:
    print(cost)

Solution (Python):
N,T = map(int, input().split())
min_cost = 1001

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

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

Solution (Python):
n, t = list(map(int, input().split()))
ct = [list(map(int, input().split())) for i in range(n)]
ct.sort()
for i in range(n):
  if ct[i][1]<=t:
    print(ct[i][0])
    exit()
print("TLE")

Solution (Python):
nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()

N, T = nl()
min_c = 10000
for i in range(N):
    c, t = nl()
    if t <= T:
        if c < min_c:
            min_c = c
if min_c == 10000:
    print('TLE')
else:
    print(min_c)

Solution (Python):
import sys
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
DVSR = 1000000007
def POW(x, y): return pow(x, y, DVSR)
def INV(x, d=DVSR): return pow(x, d - 2, d)
def DIV(x, y, d=DVSR): return (x * INV(y, d)) % d
def LI(): return [int(x) for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()
def II(): return int(input())

N,T=LI()
INL = [LI() for i in range(N)]

res = INTMAX
for c, t in INL:
    if t <= T:
        res = min(res, c)

if res == INTMAX:
    print('TLE')
else:
    print(res)

Solution (Python):
N,T = map(int,input().split())
cos = []
for i in range(N):
    c,t = map(int,input().split())
    if t <= T:
        cos.append(c)
if cos == []:
    print("TLE")
else:
    print(min(cos))

Solution (Python):
N,T=list(map(int,input().split()))
v=[]
for z in range(N):
  c,t=list(map(int,input().split()))
  v.append((c,t))

min_cost=99999
for z in v:
  if z[1]<=T and min_cost>z[0]:
    min_cost=z[0]

if min_cost==99999:
  print("TLE")
else:
  print(min_cost)

Solution (Python):
N, T = map(int, input().split())
min_cost = 2000
for i in range(N):
    c, t = map(int, input().split())
    if t <= T:
        min_cost = min(min_cost, c)
        
if min_cost == 2000:
    print("TLE")
else:
    print(min_cost)

Solution (Python):
N, T = map(int, input().split())
a = 0
b = 0
for i in range(N):
    c, t = map(int, input().split())
    if t <= T:
        a = c
        if b == 0 and a > 0:
            b = a
        else:
            b = min(a, b)
if b == 0:
    print("TLE")
else:
    print(b)

Solution (Python):
n, t = map(int, input().split())
min_cost = 9999
for _ in range(n):
  ci, ti = map(int, input().split())
  if ti <= t:
    min_cost = min(min_cost, ci)
if min_cost == 9999:
  print('TLE')
else:
  print(min_cost)

Solution (Python):
import copy
from operator import itemgetter

n, t = map(int, input().split())
p = []
for i in range(n) :
    a = [int(num) for num in input().split()]
    p.append((a[0],a[1]))

answer = []
for j in range(len(p)) :
    e = p[j]
    if (e[1] <= t):
        answer.append(copy.deepcopy(e))
answer = sorted(answer, key=itemgetter(0), reverse=False)
    
if len(answer) == 0 :
    print("TLE")
else :
    print(answer[0][0])

Solution (Python):
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())

dicts = {key:value for key, value in zip(c, t)}
dicts = sorted(dicts.items())
for key, value in dicts:
    if value <= T:
        print(key)
        exit()

print('TLE')

Solution (Python):
N, T = map(int, input().split())
mn = 1001
for i in range(N):
  c,t = map(int, input().split())
  if t <= T:
    mn = min(c,mn)
print(mn if mn < 1001 else 'TLE')

Solution (Python):
N, T = map(int, input().split())
ans = 1000
flag = True
for i in range(N):
    c,t = map(int, input().split())
    if T >= t and c <= ans:
        ans = c
        flag = False
if flag:
    print("TLE")
else:
    print(ans)

Solution (Python):
N,T=(int(i) for i in input().split())
c=[]
t=[]
count=0
for i in range(N):
    c_tmp,t_tmp=input().split()
    if int(t_tmp)<=T:
        c.append(int(c_tmp))
        t.append(int(t_tmp))
        count+=1
if count!=0:
    print(min(c))
else:
    print("TLE")

Solution (Python):
N,T = map(int, input().split())

ans = 10000

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

if ans!=10000:
  print(ans)
else:
  print("TLE")

Solution (Python):

N, T = map(int, input().split())
ans = 10 ** 3 + 1

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

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

Solution (Python):
n,t=map(int,input().split())
ans=float("inf")
for i in range(n):
    a,b=map(int,input().split())
    if b<(t+1):
        ans=min(a,ans)

if ans==float("inf"):
    print("TLE")
else:
    print(ans)

Solution (Python):
def abc():
    n, t = map(int, input().rstrip().split())
    costs = []
    for i in range(n):
        a, b = map(int, input().rstrip().split())
        if b <= t:
            costs.append(a)
    if len(costs) == 0:
        print('TLE')
        return
    print(sorted(costs)[0])


abc()

Solution (Python):
n, t = map(int, input().split())
lst = []
for i in range(n):
    lst.append(input().split())

ans = 'TLE'
count = 10000
for i in lst:
    time = int(i[1])
    cost = int(i[0])
    if time <= t and count > cost:
        count = cost
        ans = str(count)

print(ans)

Solution (Python):
N, T = map(int, input().split())
ans = 1001
for _ in range(N):
    c, t = map(int, input().split())
    if t <= T:
        ans = min(ans, c)

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

Solution (Python):
N,T = map(int,input().split())

INF = 10**9

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

answer = min_cost if min_cost < INF else 'TLE'
print(answer)

Solution (Python):
n,t=map(int,input().split())
a=[]
for i in range(n):
  b,c=map(int,input().split())
  a.append((b,c))
a.sort()
for i in range(n):
  if a[i][1]<=t:
    print(a[i][0])
    break
  if i == n-1:
    print("TLE")

Solution (Python):
N , T = input().split()

N = int(N)
T = int(T)

cos_mini = 1001

for i in range(N):

    c,t = input().split()

    c = int(c)
    t = int(t)

    if t <= T and c < cos_mini:

        cos_mini = c


if (cos_mini <= 1000):
    print(cos_mini)
else:
    print("TLE")

Solution (Python):
N, T = map(int, input().split())
C = []

for n in range(N):
    c, t = map(int, input().split())
    if t <= T:
        C.append(c)

if len(C) == 0:
    print('TLE')
else:
    print(min(C))

Solution (Python):
import sys
sys.setrecursionlimit(10**7)
def lmi(): return list(map(int, input().split()))

n, t = lmi()
c = [0] * n
for i in range(n):
    c[i] = lmi()

d = [x[0] for x in c if x[1] <= t]
if d == []:
    print('TLE')
else:
    print(min([x[0] for x in c if x[1] <= t]))

Solution (Python):
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 = 1000000
for i in range(n):
    if t[i] <= T:
        ans = min(ans, c[i])

if ans != 1000000:
    print(ans)
else:
    print("TLE")

Solution (Python):
n, t = list(map(int, input().split()))
a = [list(map(int, input().split())) for i in range(n)]

cost = []
time = []
for i in range(n):
    cost.append(a[i][0])
    time.append(a[i][1])

l = []
count = 0

for i in range(n):
    if t < time[i]:
        count += 1
    else:
        l.append(cost[i])

if count == n:
    print("TLE")
else:
    print(min(l))

Solution (Python):
import bisect
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")

N, X = list(map(int, sys.stdin.readline().split()))
C, T = list(zip(*[map(int, sys.stdin.readline().split()) for _ in range(N)]))

T = np.array(T)
C = np.array(C)
if (T <= X).any():
    print(min(C[T <= X]))
else:
    print('TLE')

Solution (Python):
N, T = map(int, input().split())

i = []
for _ in range(N):
    c, t = map(int, input().split())
    i.append([c,t])

cmin = 1001
for n in range(N):    
    if i[n][1] <= T and i[n][0] < cmin:
        cmin = i[n][0]

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

Solution (Python):
n,t=map(int,input().split())
ans=9999
for i in range(n):
    c,tt=map(int,input().split())
    if t>=tt:
        ans=min(ans,c)
if ans<9999:
    print(ans)
else:
    print('TLE')

Solution (Python):
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)

Solution (Python):
N,T = map(int,input().split())

ans = 10000

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

if(ans == 10000):
        print('TLE')
else:
        print(ans)

Solution (Python):
n,t = map(int,input().split())
lis = [list(map(int,input().split())) for x in range(n)]

lis = sorted(lis)
def TimeLimit(lis):
    for x in lis:
        if t >= x[1]:
            print(x[0])
            return
    else:
        print('TLE')
TimeLimit(lis)

Solution (Python):
import numpy as np



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

Cost = np.zeros((N, 2))
for i in range(N):
    Cost[i, 0], Cost[i, 1] = map(int, input().split())




Cost_Best = 100000

for i in range(N):

    if Cost[i,1] <= T:
        if Cost[i,0] < Cost_Best:
            Cost_Best = Cost[i,0]

if Cost_Best == 100000:
    print( "TLE" )
else:
    print(int(Cost_Best))

Solution (Python):
n,t = map(int,input().split())
out = 1001
o = t+1
outnum = 1001
for i in range(n):
  c, tim = map(int,input().split())
  if tim <= t and c < out:
    out = c
    outnum = i
if outnum == 1001:
  print('TLE')
else:
  print(out)

Solution (Python):
n,t=map(int,input().split())
x = []
y = []
z=[]
for i in range(n):
    x1,y1=map(int,input().split())
    x.append(x1)
    y.append(y1)
for i in range(n):
    if y[i]<=t:
        z.append(x[i])
if len(z)==0:
    print("TLE")
else:
    print(min(z))

Solution (Python):

n, t = map(int, input().split())
v = [list(map(int, list(input().split()))) for i in range(n)]
list = []
for i in range(n):
    if v[i][1] <= t:
        list.append(v[i][0])
if list == []:
    print("TLE")
else:
    print(min(list))

Solution (Python):
n,t=map(int, input().split())
v=[list(map(int,list(input().split()))) for i in range(n)]
x=[]
for i in range(n):
    if v[i][1]<=t:
        x.append(v[i][0])

if x==[]:
    print('TLE')
else:
    print(min(x))

Solution (Python):
N, T = map(int, input().split())
min_c = 10**7

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

if min_c==10**7:
  print('TLE')
else:
  print(min_c)

Solution (Python):
n,t=map(int,input().split())
c=[]
tt=[]
for i in range(n):
 x,y=map(int,input().split())
 if t-y>=0:
  c.append(x)
  tt.append(y)
 else:
  c.append(1001)
  tt.append(y)

if min(c)==1001:
 print("TLE")
else:
 print(min(c))

Solution (Python):
n,t = map(int,input().split())
ct=[]
for _ in range(n):
    ct.append(list(map(int,input().split())))
ct = sorted(ct,key=lambda x:x[0])
for i in range(n):
    if ct[i][1]<=t:
        print(ct[i][0])
        exit()
print("TLE")

Solution (Python):
n,t = map(int,input().split())
li = [list(map(int,input().split())) for i in range(n)]

lians = []
for i in range(n):
  if li[i][1] <= t:
    lians.append(li[i][0])
if len(lians) == 0:
  print("TLE")
else:
  print(min(lians))

Solution (Python):
n, T = map(int, input().split())
mini = 10 ** 4
for i in range(n):
    c, t = map(int, input().split())
    if t <= T:
        if c < mini:
            mini = c

print(mini if mini != 10 ** 4 else "TLE")

Solution (Python):
n, t = map(int, input().split())

mincost = 1001

for i in range(n):
    c , time = map(int, input().split())

    if c < mincost and time <= t:
        mincost = c

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

Solution (Python):
n, t = map(int, input().split())
ct = [input() for i in range(n)]
m = 1001
for i in ct:
    cost, time = i.split()
    cost = int(cost)
    time = int(time)
    if time <= t:
        if cost < m:
            m = cost
if m > 1000:
    print('TLE')
else:
    print(m)

Solution (Python):
number,time = map(int,input().split())
x = [list(map(int,input().split())) for i in range(number)]
a = []

for i in range(number):
    if x[i][1] <= time:
        a.append(x[i][0])
if len(a) > 0:
    print(min(a))
else:
    print("TLE")

Solution (Python):
number,time = map(int,input().split())
x = [list(map(int,input().split())) for i in range(number)]
a = []

for i in range(number):
    if x[i][1] <= time:
        a.append(x[i][0])
if len(a) > 0:
    print(min(a))
else:
    print("TLE")

Solution (Python):
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))

Solution (Python):
n, timeLimit = map(int, input().split())
opt = []
for _ in range(n):
        c, t = map(int, input().split())
        if t <= timeLimit :
                opt.append(c)
if opt == [] :
        print('TLE')
else:
        print(min(opt))

Solution (Python):
n,t=map(int,input().split())
l=[[int(j) for j in input().split()] for i in range(n)]
a=[]
for i in range(n):
    if l[i][1]<=t:
        a.append(l[i][0])
if a!=[]:
    print(min(a))
else:
    print("TLE")

Solution (Python):
N,T=map(int,input().split())
L=[]
for i in range(N):
  c,t=map(int,input().split())
  if t > T:
    1+1
  else:
    L.append(c)
if len(L)>0:
  print(min(L))
else:
  print("TLE")

Solution (Python):
N,T = map(int, input().split())
x = [list(map(int, input().split())) for i in range(N)]
c = []
for i in range(N):
  if x[i][1] <= T:
    c.append(x[i][0])
if c == []:
  print("TLE")
else:
  print(min(c))

Solution (Python):
N, T = map(int, input().split())
ct = []
for _ in range(N):
    ct.append(list(map(int,input().split())))

ans = 1001
for i in ct:
    if T >= i[1]:
        ans = min(ans, i[0])

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

Solution (Python):
N, T = map(int, input().split())
ans = 1001

for i in range(N):
	c, t = map(int, input().split())

	if t <= T and ans > c:
		ans = c

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

Solution (Python):
N,T=map(int,input().split())
ans=10**10
for i in range(N):
    c,t=map(int,input().split())
    if c<ans and t<=T: ans=c
print("TLE" if ans==10**10 else ans)

Solution (Python):
N, T = map(int, input().split())

ans = 10**8
for i in range(N):
    c, t = map(int, input().split())
    if t <= T and c < ans:
        ans = c

print(ans) if ans != 10**8 else print('TLE')

Solution (Python):
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())

cost= 10000
for i in range(n):
    if t[i] <= T and c[i] <= cost:
        cost = c[i]
        
if cost == 10000:
    print("TLE")
else:
    print(cost)

Solution (Python):
N, T = [int(x) for x in input().split()]

ok = 2000
for _ in range(N):
  c, t = [int(x) for x in input().split()]
  if t <= T:
    ok = min(ok, c)

print("TLE" if ok == 2000 else ok)

Solution (Python):
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)

Solution (Python):
N,T = map(int,input().split())

C = []

for i in range(N):
    cc,tt = map(int,input().split())
    if tt <= T:
        C.append(cc)
C.sort()

if len(C) > 0:
    print(C[0])
else:
    print("TLE")

Solution (Python):
N, T = map(int,input().split())

ans = 10**9
TLE = 1
for i in range(N):
    ct = list(map(int,input().split()))
    if ct[1] <= T:
        TLE = 0
        if ct[0] < ans:
            ans = ct[0]

if TLE == 0:
    print(ans)
else:
    print('TLE')

Solution (Python):
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    n , T =f()

    minc = 10000
    for i in range(n):
        c,t = f()
        if t<= T:
            minc = min(minc, c)
    
    if minc == 10000:
        print('TLE')
    else:
        print(minc)

solve()

Solution (Python):

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)

Solution (Python):
n,t=map(int,input().split())
cost=1001
for i in range(n):
  ci,ti=map(int,input().split())
  if ti<=t and ci<=cost:
    cost=ci
print("TLE" if cost==1001 else cost)

Solution (Python):
a, b = map(int,input().split())
list_ = []
for i in range(a):
    s, t = map(int,input().split())
    if t <= b:
        list_.append(s)

print(min(list_) if len(list_) else 'TLE')

Solution (Python):
n, t = map(int, input().split())
ct = [list(map(int, input().split())) for _ in range(n)]
ans = []

for i in ct:
    if i[1] <= t:
        ans.append(i)

if not ans:
    print('TLE')
else:
    ans.sort(key=lambda x: x[0])
    print(ans[0][0])

Solution (Python):
N,T = map(int,input().split())
s = set()
for _ in range(N):
    c,tt = map(int,input().split())
    if tt <= T:s.add(c)
if len(s) == 0:print('TLE')
else:print(min(s))

Solution (Python):
N, T = map(int, input().split())

cl = []
for _ in range(1 ,N+1):
  c, t = map(int, input().split())
  if t <= T:
    cl.append(c)

print("TLE" if not cl else min(cl))

Solution (Python):
from sys import stdin
N, T = [int(x) for x in stdin.readline().rstrip().split()]
ct = [[int(x) for x in stdin.readline().rstrip().split()] for _ in range(N)]
path = [k[0] for k in ct if k[1] <= T]
path.sort()
if len(path) == 0:
    print('TLE')
else:
    print(path[0])