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())
min = 100000
for i in range(n):
  c,long = map(int,input().split() )
  if t >= long and min > c:
    min = c
if min == 100000:
  print("TLE")
else:
  print(min)

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

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

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

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

for c, t in ct:
    if t <= T:
        mi = min(c, mi)

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

Solution (Python):
N, T = map(int, raw_input().split())
small_c = 10000
for i in range(N):
  c, t = map(int, raw_input().split())
  if t <= T:
    if c < small_c:
      small_c = c
if small_c > 1000:
  print('TLE')
else:
  print(small_c)

Solution (Python):

n, largeT = map(int, input().split())
c = []
t = []
ans = []
for i in range(n):
    c, t = map(int, input().split())
    if t <= largeT:
        ans.append(c)
try:
    print(min(ans))
except ValueError:
    print('TLE')

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

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

ans="TLE"
for i in range(N):
  a,b=map(int,input().split())
  if b <= T:
    if ans=="TLE" or ans > a:
      ans=a

print(ans)

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

while(N):
    c,t=input().split()
    c=int(c)
    t=int(t)
    if(t<=T):
        if(ans==None):
            ans=c
        else:
            ans=min(ans,c)
    N-=1

if(ans==None):
    print("TLE")
else:
    print(ans)

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

cost = 1001
flag = False

for i in range(n):
    if li[i][1] <= t:
        flag = True
        if li[i][0] < cost:
            cost = li[i][0]

if flag == True:
    print(cost)
else:
    print("TLE")

Solution (Python):
N,T = map(int,input().split())
c = [0]*N 
cost = 1001
for i in range(N):
    tmp_c,tmp_t = map(int,input().split())
    if tmp_t <= T:
        cost = min(tmp_c,cost)
if cost == 1001:
    cost = "TLE"
print(cost)

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

for c in l:
    if c[1]<=n:
        e.append(c[0])

if not e:
   print("TLE")
else: 
    print(min(e))

Solution (Python):

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)

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

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

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

if ans == 10000:
  ans = "TLE"

print(ans)

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

Solution (Python):
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())

N,T = inpl()
ans = INF
for i in range(N):
    c,t = inpl()
    if t <= T:
        ans = min(c,ans)

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

Solution (Python):
N, T = map(int,input().split())
c = list()
t = list()
for _ in range(N):
    ci, ti = map(int, input().split())
    if ti <= T:
        c.append(ci)
        t.append(ti)

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

Solution (Python):
N, T = map(int,input().split())
c = list()
t = list()
for _ in range(N):
    ci, ti = map(int, input().split())
    c.append(ci)
    t.append(ti)

ans = 100000
for i in range(N):
    if t[i] <= T:
        ans = min(ans, c[i])

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

Solution (Python):
N,T = (int(i) for i in input().split())
result = list()
for ii in range(N):
    c,t = (int(i) for i in input().split())
    if t <= T:
        result.append(c)
    else:
        continue
if result:
    result.sort()
    print(result[0])
else:
    print("TLE")

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


a =[]
for i in range(n):
    if li[i][1] <= t:
        a.append(i)

b = []
for i in a:
    b.append(li[i][0])

if b:
    print(min(b))
else:
    print("TLE")

Solution (Python):
NT=[int(i) for i in input().split()]
ct=[[int(j) for j in input().split()] for i in range(NT[0])]

ans=0
for i in range(NT[0]):
	if ct[i][1]<=NT[1]:
		if ct[i][0]<ct[ans][0]:
			ans=i
if ct[ans][1]<=NT[1]:
	print(ct[ans][0])
else:
	print("TLE")

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

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

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

Solution (Python):
def read():
    return int(input())


def readlist():
    return list(map(int, input().split()))


def readmap():
    return map(int, input().split())


N, T = readmap()
c = []
t = []
for _ in range(N):
    ci, ti = readmap()
    c.append(ci)
    t.append(ti)

ans = 10000
for i in range(N):
    if t[i] <= T:
        ans = min(ans, c[i])

if ans > 1000:
    print("TLE")
else:
    print(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:
        ans = min(ans, c)
print(ans if ans < 10**8 else "TLE")

Solution (Python):
N, T =  map(int, input().split())
n = []
t = []
ans = None
for i in range(N):
    ni, ti = map(int, input().split())
    n.append(ni)
    t.append(ti)

for i in range(N):
    if not T < t[i]:
        if ans == None:
            ans = n[i]
        elif ans > n[i]:
            ans = n[i]

if ans == None:
    print("TLE")
else:
    print(ans)

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

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

Cost, Time = ct[0]
for c, t in ct:
    if t <= T and Cost >= c:
        Cost = c
        Time = t

if Time <= T:
    print(Cost)
else:
    print('TLE')

Solution (Python):
I=lambda:map(int,input().split())
n,k=I()
s=1001
for i in range(n):
  a,b=I()
  if b<=k:
    s=min(s,a)
if s==1001:
  print('TLE')
else:
  print(s)

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

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

print(Ans if Ans != 9999 else "TLE")

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

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

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

c = min((c for c, t in ct if t <= T), default='TLE')
print(c)

Solution (Python):
N, T = map(int,input().split())
mincost = 100000
for i in range(N):
    ci, ti = map(int,input().split())
    if ti <= T:
            mincost = min(mincost,ci)

if mincost == 100000:
    print('TLE')
else:
    print(mincost)

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

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

cost = float('inf')

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

if cost == float('inf'):
    print('TLE')
else:
    print(cost)

Solution (Python):
import numpy as np
n, t = map(int, input().split())
cs = list()
ts = list()
for i in range(n):
   cc,tt = map(int, input().split())
   cs.append(cc)
   ts.append(tt)

np_cs = np.array(cs)
np_ts = np.array(ts)

avairable_ind = np.where(np_ts <= t)

if avairable_ind[0].size == 0:
    print("TLE")
else:
    print(np_cs[avairable_ind].min())

Solution (Python):
n, t = map(int, input().split())
a = [list(map(int, input().split())) for i in range(n)]
inf  = float('inf')
ans = inf
for i in range(n):
    if a[i][1] <= t:
        ans = min(ans, a[i][0])
if ans == inf:
    print("TLE")
else:
    print(ans)

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

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

a = []

for i in range(n):
  cost, time = map(int, input().split())
  if time <= t:
    a.append(cost)

if len(a) is 0:
  print("TLE")
else:
  a.sort()
  print(a[0])

Solution (Python):
def getinputdata():

    array_result = []    
    array_result.append(input().split(" "))

    flg = True

    try:
        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = True

            else:

                flg = False
    finally:

        return array_result

arr_data = getinputdata()

n=int(arr_data[0][0])
t=int(arr_data[0][1])

arr = [int(arr_data[x][0]) for x in range(1,1+n) if int(arr_data[x][1]) <=t]

if len(arr)==0:
    
    print("TLE")
    
else:

    print(min(arr))

Solution (Python):
n, t = map(int, input().split())
answer = 1234567
for _ in range(n):
	x, y = map(int, input().split())
	if x < answer and y <= t:
		answer = x
if answer == 1234567:
	print("TLE")
else:
	print(answer)

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())
lst = []
ans = 10 ** 6
for _ in range(N):
    cost, time = map(int, input().split())
    if time <= T:
        ans = min(ans, cost)
if ans < 10 ** 6:
    print(ans)
else:
    print('TLE')

Solution (Python):
N,T = map(int,input().split())
ct = [list(map(int,input().split())) for i in range(N)]
m = 10000
for c,t in ct :
    if t<=T:
        if c <m:
            m = c
if m !=10000:
    print(m)
else:
    print("TLE")

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

ct = [list(map(int, input().split())) for i in range(N)]
minnum = 9999
for c, t in ct:
    if t <= T:
        if minnum >= c:
            minnum = c

print(minnum if minnum != 9999 else 'TLE')

Solution (Python):

nt = [int(i) for i in input().split()]
ctList = [[int(_) for _ in input().split()] for i in range(nt[0])]

minimunCost = 1001
for ct in ctList :
    if ct[0] < minimunCost and ct[1] <= nt[1] :
        minimunCost = ct[0]
if(minimunCost != 1001) :
    print(minimunCost)
else :
    print("TLE")

Solution (Python):
textdata = list(map(int, input().split()))
route_num = textdata[0]
time_lim = textdata[1]
candidate = []

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

for c, t in ctlist:
    if t > time_lim:
        continue
    else:
        candidate += [c]
        
if len(candidate)==0:
    print("TLE")
else:
    print(min(candidate))

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

minc=1001
for cand in root:
    if cand[1]<=T:
        if cand[0]<minc:
            minc=cand[0]
if minc==1001:
    print("TLE")
else:
    print(minc)

Solution (Python):
N, T = map(int, input().split())
x = [list(map(int, input().split())) for _ in range(N)]
x.sort(key=lambda y:y[0], reverse=True)
ans = 0
for (c, t) in x:
    if t <= T:
        ans = c
if ans == 0:
    print('TLE')
else:
    print(ans)

Solution (Python):
n,T=map(int,input().split())
c=2000
for _ in range(n):
    a,b=map(int,input().split())
    if b<=T and a<c:c=a
print(c if c<2000 else "TLE")

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

Solution (Python):

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

ans = "TLE"
for ci, ti in ct:
    if ti <= T:
        if ans == "TLE": ans = ci
        elif ci < ans: ans = ci

print(ans)

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

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

ans = 1e6
for i in range(N):
  c, t = map(int, input().split())
  if t <= T:
    ans = min(ans, c)
    
if ans > 10000:
  print("TLE")
else:
  print(ans)

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

for _ in range(N):
    c, t = map(int, input().split())
    if T >= t:
        l.append(c)

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

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

cts = []
for n in range(N):
  c, t = map(int, input().split())

  cts.append( (c,t)) 

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

cts = sorted(cts, key=lambda x:x[0])

if len(cts) >= 1:
  print(cts[0][0])
else:
  print('TLE')

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

minC = 1001
for i in range(n):
  c, t = list(map(int, input().split()))
  if t > tt:
    continue
  
  minC = min(minC, c)

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

Solution (Python):



def main():
    n, large_t = map(int, input().split())
    cost = 10000

    for i in range(n):
        ci, ti = map(int, input().split())

        if ti <= large_t:
            cost = min(cost, ci)

    if cost != 10000:
        print(cost)
    else:
        print('TLE')


if __name__ == '__main__':
    main()

Solution (Python):
N, T = map(int, input().split())
inf = float("inf")
cost = inf
for i in range(N):
    ci, ti = map(int, input().split())
    if ti <= T:
        if ci <= cost:
            cost = ci

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

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

try:
    c = min(c for c, t in ct if t <= T)
    print(c)
except ValueError:
    print('TLE')

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

Solution (Python):
n, t = map(int, input().split())
route = [list(map(int, input().split())) for _ in range(n)]
ans = float("inf")
for r in route:
	if r[1] <= t:
		ans = min(ans, r[0])

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

Solution (Python):
route_num, limit = map(int, input().split(' '))

costs = []
spends = []
for i in range(route_num):
    cost, spend = map(int, input().split(' '))
    costs.append(cost)
    spends.append(spend)

max_cost = 2000
for cost, spend in zip(costs, spends):
    if spend <= limit and cost < max_cost:
        max_cost = cost

if max_cost == 2000:
    print("TLE")
else:
    print(max_cost)

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

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

for i in range(n):
    x, y = map(int, input().split())
    if y <= t:
        t_min = min(t_min, x)

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

Solution (Python):
n, t = map(int, input().split())
a = [list(map(int, input().split())) for i in range(n)]
min = 1001
ans = 0
flag = 0
for i in a:
    if i[1] <= t and i[0] < min:
        min = i[0]
        flag = 1
if flag:
    print(min)
else:
    print("TLE")

Solution (Python):



def get_line():
    return input()


def get_tokens():
    return get_line().split()


def get_ints():
    return [int(_) for _ in get_tokens()]


def main():
    n, t = get_ints()
    p = []
    for _ in range(n):
        p.append(get_ints())
    p = [_ for _ in p if _[1] <= t]
    p = [_[0] for _ in p]
    ans = min(p) if len(p) else 'TLE'
    print(ans)
        
if __name__ == '__main__':
    main()

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

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

if mc is 9999:
    print("TLE")
else:
    print(mc)

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

ans = 'TLE'
for i in range(N):
    c, t = [int(i) for i in input().split()]
    if t <= T and (ans == 'TLE' or c < ans):
        ans = c

print(ans)

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

cost=10000
for i in range(N):
    if a[i][1] <= T:
        cost = min(cost,a[i][0])



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

Solution (Python):
n,t=map(int, input().split())
ans=10000
for i in range(n):
    a,b=map(int, input().split())
    if b<=t:ans=min(ans,a)
if ans==10000:ans='TLE'
print(ans)

Solution (Python):
import sys

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

ans_c = sys.maxsize
ans_t = sys.maxsize

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

if ans_t > T:
    print("TLE")
else:
    print(ans_c)

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

A=[]
for i in range(N):
	c,t=map(int, raw_input().split())
	if t<=T:
		A.append(c)

if len(A)>0:
	A.sort()
	print A[0]
else:
	print "TLE"

Solution (Python):


N,T=map(int,raw_input().split())
ct=[]
for i in xrange(N):
 c,t=map(int,raw_input().split())
 if t<=T:
  ct.append(c)
ct.sort()
if ct==[]:
 print 'TLE'
else:
 print ct[0]

Solution (Python):
N, T = [int(_) for _ in input().split()]
CT = [[int(_) for _ in input().split()] for i in range(N)]

cs = [c for c, t in CT if t <= T]

if cs:
    print(min(cs))
else:
    print("TLE")

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

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

if Ans==2000:
    print("TLE")
else:
    print(Ans)

Solution (Python):
N, T = raw_input().split()
sct = []
for i in xrange(int(N)):
    ci, ti = raw_input().split()
    if int(ti) <= int(T):
        s = set()
        s.add(ci)
        s.add(ti)
        sct.append(int(ci))
print('TLE' if sct ==[] else min(sct))

Solution (Python):
N,limit = map(int,input().split())
costs = []
for i in range(N):
	c,t = map(int,input().split())
	if limit >= t:
		costs.append(c)

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

Solution (Python):
i=lambda:map(int,input().split());N,T=i();a=min([2000]+[c for c,t in[i()for _ in[0]*N]if t<=T]);print('TLE'*(a>1000)or a)

Solution (Python):
i=lambda:map(int,input().split());N,T=i();print(min([c for c,t in[i()for _ in[0]*N]if t<=T],default='TLE'))

Solution (Python):
i=lambda:map(int,input().split())
N,T=i()
a=9999
for _ in[0]*N:
  c,t=i()
  a=[min(a,c),a][t>T]
print('TLE'*(a>1000)or a)

Solution (Python):
n, T = map(int, input().split())
c = []
t = []
cost = []
for i in range(n):
    _c, _t = map(int, input().split())
    c.append(_c)
    t.append(_t)
    if T >= t[i]:
        cost.append(c[i])

if not(cost):
    print("TLE")
else:
    print(min(cost))

Solution (Python):
n,T=map(int,input().split())
arr=[]
for i in range(n):
	c,t=map(int,input().split())
	arr.append((c,t))
arr.sort()
flag=0
minval=10**19
for i in range(n):
	if(arr[i][1]<=T):
		minval=min(minval,arr[i][0])
if(minval==10**19):
	print('TLE')
else:
	print(minval)

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

Solution (Python):
N, T = list(map(int, input().split(" ")))
c = []
t = []

for i in range(N):
    ci, ti = input().split(" ")
    c.append(int(ci))
    t.append(int(ti))
if min(t) > T:
    print("TLE\n")

else:
    cost = 10000
    for i in range(N):
        if cost > c[i] and T >= t[i]:
            cost = c[i]
    print(cost)

Solution (Python):
N, T = map(int, input().split(" "))
inf = float('inf')

from operator import itemgetter
roots = [tuple(map(int, input().split(" "))) for i in range(N)]
roots = sorted(roots, key=itemgetter(1, 0))

def dfs(i, csum, tsum):
    if tsum + roots[i][1] <= T:
        return csum+roots[i][0] \
            if i + 1 == N else dfs(i + 1, csum+roots[i][0], tsum + roots[i][1])
    else:
        return inf if csum == 0 else csum

clist = [dfs(i, 0, 0) for i in range(N)]
ans = min(clist)

print('TLE' if ans == inf else ans)

Solution (Python):


n,t_limit = (int(x) for x in input().split())

cost_list = list()
time_list = list()

while n >= 1:
    ci,ti = (int(x) for x in input().split())
    if ti <= t_limit:   
        cost_list.append(ci)    
        time_list.append(ti)    
        n = n - 1
    else:
        n = n - 1
if not time_list:   
    print('TLE')
else:
    print(min(cost_list))

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

N=int(N)
T=int(T)
c1=list()
c2=list()
for i in range(N):
    temp=input().split(" ")
    c1.append(int(temp[0]))
    c2.append(int(temp[1]))

if min(c2)>T:
    print("TLE")
else:
    min_cost=min([c1[i] for i in range(len(c2)) if c2[i]<=T])
    print(c1[c1.index(min_cost)])

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

CT = []
for _ in range(N):
    CT.append(tuple(map(int, input().split())))

CT1 = [ct for ct in CT if ct[1] <= T]

if len(CT1) == 0:
    print('TLE')
else:
    CT2 = sorted(CT1, key=lambda ct1: ct1[0])
    print(CT2[0][0])

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

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

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

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

Solution (Python):


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

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

min_c = float('inf')
for i in range(N):
    if cNtN[i][1] <= T and cNtN[i][0] < min_c:
        min_c = cNtN[i][0]

if min_c == float('inf'):
    print('TLE')
else:
    print(min_c)

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 len(L)==0:
    print("TLE")
else:
    print(min(L))

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

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

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

if ans == 1234567:
    print("TLE")
else:
    print(ans)

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

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

INF = 1 << 30
ans = INF

for i in range(N):
    if t[i] <= T:
        ans = min(ans, c[i])

if ans < INF:
    print(ans)
else:
    print('TLE')

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

c = [i for i in range(n)]
t = [i for i in range(n)]

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


now = 1001
nans = 0

for i in range(n):
    if t[i] <= time:
        if c[i] < now:
            now = c[i]
            nans = i


if now == 1001:
    print("TLE")

else:
    print(now)

Solution (Python):
num, time = map(int, input().split(' '))


columns = []
able_columns = []
my_dict = {}


for i in range(num):
    columns = (list(map(int,input().rstrip().split(' '))))
    if columns[1] <= time:
        able_columns.append(columns)

if able_columns == []:
    print('TLE')


else:
    for i in able_columns:
        my_dict[i[0]] = i[1]
    print(min(my_dict))

Solution (Python):
N, limit = map(int, input().split())
arr = [list(map(int, input().split())) for i in range(N)]
ans = 2000
for i in range(N):
    if arr[i][1] <= limit:
        ans = min(ans, arr[i][0])
if ans == 2000:
    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:
    if c < ans:
        ans = c
if ans < 1001:
  print(ans)
else:
 print('TLE')

Solution (Python):
n = list(map(int, input().strip().split(' ')))
b = n[1]
h = 100000
c = 100000
int(c)
a = []
for i in range(n[0]):
  a.append(list(map(int, input().split())))
  if a[i][1] <= n[1] and a[i][0] <= c:
    h = a[i][1]
    c = a[i][0]
    

if h <= n[1]:
  print(c)
else:
    print("TLE")

Solution (Python):

''' こんな感じ
3
100 15
300 20
200 30
'''



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

flag = True

CT = []
for i in range(N):
    c, t = map(int,input().split())
    if t <= Limit:
        CT.append([c,t])
        flag = False
    else:
        pass
if flag == True:
    print('TLE')
    exit()

CT.sort()

print(min(CT)[0])



'''
5 70
7 60
1 80
4 50
2 56
3 55
'''

Solution (Python):
a=[]
b=1001
n,t=map(int,input().split(" "))
for _ in range(n):
    a.append(tuple(map(int,input().split(" "))))
for i in range(n):
    if t>=a[i][1]:
        if b>a[i][0]:
            b=a[i][0]
if b !=1001:
    print(b)
else:
    print("TLE")

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


cost = 10000
res = [0,0]

for i in range(n[0]):
    get = input().split(" ")
    get = list(map(int,get))
    
    if get[1] <= n[1]:
        res[1] = get[1]
        if get[0] < cost:
            cost = get[0]


if res[1]==0:
    print('TLE')
else:print(cost)

Solution (Python):
n,t=[int(s)for s in input().split()]
cost=[]
for _ in range(n):
  c,ti=[int(s)for s in input().split()]
  if ti<=t:cost.append(c)
if len(cost)==0:print("TLE")
else:
  cs=sorted(cost)
  print(cs[0])

Solution (Python):
A=[]
while True:
    try:
        A.append(list(map(int,input().split())))
              
 
    except:
        break;

T = A[0][1]
Tc = 0
min = A[1][0] 
 
for i in range(1, len(A)):
  j = int(i)
  if A[j][1] <= T:
    Tc = Tc+1
    if A[j][0] <= min:
      min = A[j][0]
     
      
if Tc == 0:
  print("TLE")
else:
  print(min)

Solution (Python):
import sys
N, T = map(int, sys.stdin.readline().split(" "))
roots = [tuple(map(int, sys.stdin.readline().split(" "))) for i in range(N)]

from operator import itemgetter

roots = (sorted(roots, key=itemgetter(1, 0)))

def dfs(i, csum, tsum):
    if tsum + roots[i][1] <= T:
        if i+1 == N:
          return csum + roots[i][0]
        else:
          return dfs(i+1, csum+roots[i][0], tsum+roots[i][1])
    else:
        return 100000000 if csum == 0 else csum

ans = 100000000
for ii in range(N):
  csum = dfs(ii, 0, 0)
  if ans > csum:
    ans = csum
  if csum == 100000000:
    is_do = False
    break

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

Solution (Python):
import sys
import socket

hostname = socket.gethostname()

if hostname == 'F551C':
    sys.stdin = open('b1.in')


def read_int_list():
    return list(map(int, input().split()))


def read_str_list():
    return input().split()


def read_int():
    return int(input())


def read_str():
    return input()


def main():
    N, T = read_int_list()
    res = 9999
    for i in range(N):
        c, t = read_int_list()
        if t <= T:
            if c < res:
                res = c
    if res == 9999:
        res = 'TLE'
    print(res)


main()

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

cost = 2000
for cn, tn in ct:
    if cn <= cost and tn <= t:
        cost = cn
if cost == 2000:
    print("TLE")
else:
    print(cost)

Solution (Python):
import sys
N,T =map(int,input().split())
c=[]
t=[]
t_count=0
for i in range(N):
    c_n,t_n=map(int,input().split())
    if t_n>T:
        t_count+=1
    if t_n<=T:
        c.append(c_n)
        t.append(t_n)
        
            
        
    

if t_count==N:
    print("TLE")
    sys.exit()

print(min(c))

Solution (Python):
N, T =(int(x) for x in input().split())
a = 1001
b = 1001
for i in range(N):
    c, t =(int(z) for z in input().split())
    if c <= b:
        if t <= T:
            a = t
            b = c
    else:
        pass
if T >= a:
    print(b)
else:
    print('TLE')