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())
c = []
for i in range(n):
  ci, ti = map(int, input().split())
  if ti <= t:
    c.append(ci)
if c == []:
  print("TLE")
else:
  print(min(c))

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

ct = sorted(list(filter(lambda x: x[1] <= T,ct)))
if len(ct) == 0:
  print('TLE')
else:
  print(ct[0][0])

Solution (Python):
N,T=map(int,input().split())
C=1000
X=0
for i in range(N) :
  A,B=map(int,input().split())
  if A<=C and B<=T :
    C=A 
    X=B 
if X==0 :
  print("TLE")
else :
  print(C)

Solution (Python):
n,t=map(int,input().split())
d=0
c=1000
for i in range(n):
  a,s=map(int,input().split())
  if s<=t and c>=a:
    c=a
    d=i+1
if d==0:
  print("TLE")
else:
  print(c)

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

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

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

cands = list(map(lambda ct: ct[0], filter(lambda ct: ct[1] <= T, cts)))
if len(cands) == 0:
    ans = "TLE"
else:
    ans = min(cands)

print(ans)

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_min = 100000

for i in range(n):
    if cost_min > c[i] and t[i] <= T:
        cost_min = c[i]

if cost_min == 100000:
    print("TLE")
else:
    print(cost_min)

Solution (Python):
n, t_max = map(int, input().split())
ans = 'TLE'

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

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

min_cost = float('inf')
for c, t in route:
    if t <= T:
        min_cost = min(min_cost, c)

print(min_cost if min_cost != float('inf') else 'TLE')

Solution (Python):
N,T=map(int,input().split())
c,t=[],[]
for i in range(N):
  a,b=map(int,input().split())
  c.append(a)
  t.append(b)
if min(t)>T:
  print("TLE")
else:
  for i in range(N):
    if t[c.index(min(c))]>T:
      c[c.index(min(c))]=1001
    else:
      print(min(c))
      break

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

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


list_cut = [i[0] for i in list_c_t if i[1] <= T]
if len(list_cut) == 0:
  print('TLE')
else:
  print(min(list_cut))

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

def main():
    c_min = 9999
    for i in range(N):
        c, t = map(int, input().split())
        if c < c_min and t <= T:
            c_min = c
    if c_min != 9999:
        return c_min 
    else:
        return 'TLE'

if __name__ == '__main__':
    print(main())

Solution (Python):
import sys
n, t = map(int, input().split())
routes = [list(map(int, input().split())) for _ in range(n)]
for route in sorted(routes):
    if route[1] <= t:
        print(route[0])
        sys.exit()
print('TLE')

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

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

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

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())
c, t = [], []
for _ in range(N):
    ci, ti = map(int, input().split())
    c.append(ci)
    t.append(ti)
    
if min(t) > T:
    print('TLE')
    exit()
    

min_cost = float('inf')
for i in range(N):
    if t[i] <= T and c[i] < min_cost:
        min_cost = c[i]
        
print(min_cost)

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

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

Solution (Python):
N, T  = [int(i) for i in input().split()]
C_T_list = [[int(x) for x in input().split()] for _ in range(N)]
C_T_list.sort()
ans = 0
for C_T in C_T_list:
    if C_T[1] <= T:
        ans = C_T[0]
        break

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

Solution (Python):

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

Solution (Python):
N, T= map(int, input().split())
D = [list(map(int, input().split())) for _ in range(N)]
D.sort()
for c, t in D:
    if t<=T:
        print(c)
        exit()
print('TLE')

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

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

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

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

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

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

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


lst = []
for i in range(N):
    data = list(map(int, input().split()))
    if data[1] <= T:
        lst.append(data)


if lst == []:
    print("TLE")
else:
    lst.sort(key = lambda x: x[0])
    print(lst[0][0])

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

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

for _ 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 = list(map(int,input().split()))
ct = [list(map(int,input().split())) for _ in range(N)]
ct.sort(key = lambda x:x[0])
for c,t in ct:
    if t <= T:
        print(c)
        break
else:
    print("TLE")

Solution (Python):
N,T=map(int,input().split())
ct=[]
for i in range(N):
    ct1=list(map(int,input().split()))
    ct.append(ct1)
ct.sort()
for j in ct:
    if j[1]<=T:
        print(j[0])
        exit()
print('TLE')

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

Solution (Python):
import numpy as np
N, T = map(int,input().split())
c_t = np.array([input().split() for _ in range(0, N)])
c_t = c_t.astype(int)

if np.min(c_t[:,1]) <= T:
    print(np.sort(c_t[np.where(c_t[:,1] <= T)][:,0])[0])
else:
    print('TLE')

Solution (Python):

n, t0 = map(int, input().split())
ans = 10000000000
for _ in range(n):
    c, t = map(int, input().split())
    if(t<=t0 and c<=ans):
        ans = c

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

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

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

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

min_cost = 9999
for _ in range(N):
  c, t = list(map(int, input().split()))
  if t <= T and c < min_cost:
    min_cost = c
if min_cost == 9999:
  print('TLE')
else:
  print(min_cost)

Solution (Python):
a, b = map(int, input().split())  
c = list()
t = list()
ans = float("inf")

for i in range(a):
    C, T = map(int, input().split())
    if T > b:
        continue

    ans = min(ans, C)

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

Solution (Python):
N, T = map(int, input().split())
c_t = [[int(_) for _ in input().split()] for _ in range(N)]
flag = False
MinCost = 1000

for i in range(N):
    if c_t[i][1] <= T:
        flag = True
        if c_t[i][0] < MinCost:
            MinCost = c_t[i][0]

print(MinCost if flag else "TLE")

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

Solution (Python):


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

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

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):
def main112():
    N, T = (int(x) for x in input().split())

    candi = [0] * N

    for n in range(N):
        candi[n] = (list(map(int, input().split())))

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

    answer = 10000

    for c in candi:
        if c[1] <= T and c[0] < answer:
            answer = c[0]

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

main112()

Solution (Python):
import sys

N, T = [int(item) for item in input().split()]

cs, ts = [], []
for i in range(N):
  c, t = [int(item) for item in input().split()]
  cs.append(c)
  ts.append(t)
    
ct = sorted(zip(cs, ts), key=lambda x:x)
for c, t in ct:
  if t <= T:
    print(c)
    sys.exit()

print("TLE")

Solution (Python):
NT=input().split()
N=int(NT[0]);T=int(NT[1])
cs=[];ts=[]
for i in range(N):
    ct=input().split()
    cs.append(int(ct[0]))
    ts.append(int(ct[1]))
ts2=[];cs2=[]
for j in ts:
    if j<=T:
        ts2.append(j)
        cs2.append(cs[ts.index(j)])
if ts2==[]:
    print("TLE")
else:
    print(str(min(cs2)))

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

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

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

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

ct = []
for i in range(n):
    a = [int(j) for j in input().split()]
    if a[1]<=t:
        ct.append(a)
    
ct.sort()
if len(ct) > 0:
    print(ct[0][0])
else:
    print("TLE")

Solution (Python):
n, t = map(int, input().split())
ct = [list(map(int, input().split())) for i in range(n)]
ct.sort(key=lambda x : x[0])
for i in range(n):
    if ct[i][1] <= t :
        ans = ct[i][0]
        break
else:
    ans = 'TLE'
print(ans)

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

for i in range(N):
  c,t = map(int,input().split())
  Cost_Time.append([c,t])
  
Cost_Time.sort()
ans = -1
for i in range(N):
  if(Cost_Time[i][1]<=T):
    ans = Cost_Time[i][0]
    break
    
if(ans == -1):
  print('TLE')
else:
  print(ans)

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

Solution (Python):
from operator import itemgetter
N,T = [int(x) for x in input().split()]
ct = li = [[0 for j in range(2)] for i in range(N)]
for i in range(N):
    ct[i][0],ct[i][1] = [int(x) for x in input().split()]
ct.sort(key=itemgetter(0))
flag = False
for i in ct:
    if(i[1]<=T):
        print(i[0])
        flag = True
        break
if(not flag):
    print('TLE')

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

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

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

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:
    print('TLE')
else:
    print(ans)

Solution (Python):
N, T = [int(v) for v in input().split()]
min_c = float('inf')
for _ in range(N):
	c, t = [int(v) for v in input().split()]
	if t <= T:
		min_c = min(min_c, c)
if min_c == float('inf'):
	print('TLE')
else:
	print(min_c)

Solution (Python):
N,T=map(int,input().split())
CT=[list(map(int,input().split())) for _ in range(N)]
sort_CT=sorted(CT,key=lambda x:x[0])
c=0
for i in range(N):
    if sort_CT[i][1]<=T:
        print(sort_CT[i][0])
        break
    else:
        c+=1
if c==N:
    print('TLE')

Solution (Python):

N, T = map(int, input().split())
A = [list(map(int, input().split())) for _ in range(N)]
B = sorted([[c, t] for c, t in A if t <= T], key=lambda x: x[0])
if len(B) == 0:
    print('TLE')
else:
    print(B[0][0])

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

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

for i in range(N):
    if L[i][1]<=T:
        A.append(L[i][0])
if A ==[]:
    print("TLE")
else:
    print(min(A))

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

list = []
for i in range(n):
    c, t = map(int,input().split())
    if t <= T:
        list.append([c,t])
    
list.sort(key = lambda x : x[0])

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

Solution (Python):
N , T = map(int, input().split())
D = []
for i in range(1, N + 1):
    ci, ti = map(int, input().split())
    if ti <= T:
        D.append(ci)
if D == []:
    print('TLE')
else:
    ans = min(D)
    print(ans)

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

min_cost = 100000

for x in e:
    if x[1] <= t and x[0] < min_cost:
        min_cost = x[0]

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

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

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):
  ans = "TLE"
print(ans)

Solution (Python):
data = input().split()
N = int(data[0])
T = int(data[1])
c = []
t = []
i = 0
j = 0
while i < N:
  sc = input().split()
  c.append(int(sc[0]))
  t.append(int(sc[1]))
  i += 1

mn = min(t)
if mn > T:
  print("TLE")
else:
  mn = c[0]
  while j < N:
    if t[j] <= T:
      
      if mn >= c[j]:
        mn = c[j]
        ind = j
        
    j += 1

  print(c[ind])

Solution (Python):

import sys


def solve(N: int, T: int, c: "List[int]", t: "List[int]"):
    cand = [c[i] for i in range(N) if t[i] <= T]
    if len(cand) == 0:
        print("TLE")
    else:
        print(min(cand))
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    T = int(next(tokens))  
    c = [int()] * (N)  
    t = [int()] * (N)  
    for i in range(N):
        c[i] = int(next(tokens))
        t[i] = int(next(tokens))
    solve(N, T, c, t)


if __name__ == '__main__':
    main()

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

Solution (Python):
import sys


class DataUnit(object):

    def __init__(self, c, t):
        self.c = c
        self.t = t
        pass


def judging_TIME(t, max_T):
    if(t <= max_T): return True
    else: return False


def judging_COST(datali):

    if(len(datali)==0): return "TLE"

    min_cost = 10000
    for d in datali:
        if(d.c < min_cost):
            min_cost = d.c

    return min_cost



def loading_inputs():
    N, T = raw_input().split()
    N, T = int(N), int(T) 

    datalist = []
    for i in range(N):
        c_i, t_i = raw_input().split()
        c_i, t_i = int(c_i), int(t_i)

        if judging_TIME(t_i, T):
            obj = DataUnit(c_i, t_i)
            datalist.append(obj)

    return datalist






def main():

    ans = 0
    datali = loading_inputs()
    ans = judging_COST(datali)
    print ans


if __name__ == "__main__":
    main()

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

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

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

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

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

Solution (Python):
N,T=map(int,input().split())
c=[]
t=[]
for i in range(N):
    ci,ti=map(int,input().split())
    c.append(ci)
    t.append(ti)
min=10**30
for i in range(N):
    if t[i]<=T and min>=c[i]:
        min=c[i]
if min==10**30:
    print("TLE")
else:
    print(min)

Solution (Python):
N,T = map(int,input().split())
c= [list(map(int,input().split())) for i in range(N)]
s= sorted(c, key=lambda x: x[0])
flg = -1
for i in range(N):
  if s[i][1] <= T:
    flg = i
    break
print(s[flg][0] if flg != -1 else "TLE")

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

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

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

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

Solution (Python):
def ans():
  N, T = map(int,input().split())
  cost = 1e9
  for _ in range(N):
    c, t = map(int,input().split())
    if(t <= T):
      if(cost > c):
        cost = c
  if(cost == 1e9):
    print("TLE")
  else:
    print(cost)
ans()

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

min_c = 10000
for i in range(1, N+1):
    ci, ti = (int(x) for x in input().split())
    if ti <= T:
        min_c = min(min_c, ci)

if min_c > 1000:
    print("TLE")
else:
    print(min_c)

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

Solution (Python):
N, T = map(int, input().split())
min_c, count = 1000, 0
for n in range(N):
    c, t = map(int, input().split())
    if t <= T:
        count += 1
        min_c = min(min_c, c)

if count != 0:
    print(min_c)
else:
    print('TLE')

Solution (Python):
def time_limit_exceeded(N: int, T: int, CT: list) -> int:
    min_cost = float('inf')
    for c, t in CT:
        if t > T:
            continue
        if min_cost > c:
            min_cost = c
    return min_cost


if __name__ == "__main__":
    N, T = map(int, input().split())
    CT = [tuple(int(s) for s in input().split()) for _ in range(N)]
    ans = time_limit_exceeded(N, T, CT)
    print(ans if ans != float('inf') else 'TLE')

Solution (Python):

n, t = [int(x) for x in input().split()]
r = []
s = []
for _ in range(n):
    r.append([int(x) for x in input().split()])
for i in r:
    if i[1] <= t:
        s.append(i[0])
print(min(s)) if len(s) > 0 else print("TLE")

Solution (Python):
N,T=map(int,input().split())
ret=9999
for _ in range(N):
  c,t=map(int,input().split())
  if t>T:continue
  ret=min(c,ret)
if ret==9999:
  print('TLE')
else:
  print(ret)

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

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

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

ans = 10**9
for i in range(n):
    if C[i][1] <= t and C[i][0] < ans:
        ans = C[i][0]
    if i == n-1 and ans == 10**9:
        print("TLE")
        exit()
print(ans)

Solution (Python):
n,t = map(int, input().split())
ct = [list(map(int, input().split())) for i in range(n)]
ct=sorted(ct, key=lambda cti : cti[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())
CT = [list(map(int, input().split())) for i in range(N)]

ans_c = 10 ** 9
for CTi in CT:
    c, t = CTi
    if t <= T:
        ans_c = c if c < ans_c else ans_c

if ans_c == 10 ** 9:
    print('TLE')
else:
    print(ans_c)

Solution (Python):
n, time = map(int, input().split())
path = [tuple(map(int, input().split())) for _ in range(n)]
mincost = 10 ** 9
for c, t in path:
    if t <= time:
        mincost = min(mincost, c)
if mincost == 10 ** 9:
    print('TLE')
else:
    print(mincost)

Solution (Python):
from sys import stdin
n, t = [int(x) for x in stdin.readline().rstrip().split()]
data = [stdin.readline().rstrip().split() for _ in range(n)]
data = [[int(i) for i in l] for l in data]

min_time=t
min_cost=float('inf')
for d in data:
  if d[1]<=t:
    if d[0]<min_cost:
      min_cost=d[0]
if min_cost==float('inf'):
  print('TLE')
else:
  print(min_cost)

Solution (Python):
ri = lambda: int(input())
rl = lambda: list(map(int,input().split()))
rr = lambda N: [ri() for _ in range(N)]
YN = lambda b: print('YES') if b else print('NO')
INF = 10**18

N,T=rl()
ans = INF
for _ in range(N):
    c,t = rl()
    if T >= t and ans > c:
        ans = c

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

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

TLE_flag = True
result = 1001
for i in range(N):
    c, t = map(int, input().split())
    if t <= T and c < result:
        if TLE_flag:
            TLE_flag = False
        result = c

if TLE_flag:
    print('TLE')
else:
    print(result)

Solution (Python):
from sys import stdin
N, T = [int(x) for x in stdin.readline().rstrip().split()]
d = 1001
for i in range(N):
  l = list(map(int, input().split()))
  if l[1] <= T:
    if l[0] < d:
      d = l[0]
if d < 1001:
  print(d)
else:
  print('TLE')

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

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

l = []

c = 1000
k = 0

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

Solution (Python):

"""
外出しているXさんは、ABCに参加するためにスマートウォッチで最適な帰宅経路を調べることにしました。
スマートウォッチであるあなたは、N個の帰宅経路を見つけました。
Xさんがi番目の経路を使う場合、コストciかけて時間tiで帰宅できます。
時間T以内に帰宅できる経路のうち、コストが最小となる経路のコストを求めてください。
"""
def main():
    NT = list(map(int, input().split()))
    N = NT[0]
    T = NT[1]
    CandT = []
    for i in range(0, N):
        CandT.append(list(map(int, input().split())))

    CandT = sorted(CandT)  

    for i in range(0, N):
        if CandT[i][1] <= T:
            print(CandT[i][0])
            exit(0)
        else:
            pass
    print("TLE")


if __name__ == "__main__":
    main()

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

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

for i in l:
  if int(i[1]) <= t:
    print(i[0])
    exist = True
    break
if not exist:
  print("TLE")

Solution (Python):
N,T=map(int,input().split())
cp=float('inf')
for i in range(N):
  c,t=map(int,input().split())
  if t<=T and c<cp:
    cp=c
print('TLE' if cp==float('inf') else cp)

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

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

for a in c_t2: 
    if a[1] <= T:
        print(a[0])
        exit()
print('TLE')

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

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)
if C == []:
    print('TLE')
else:
    print(min(C))

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

Solution (Python):


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

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

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

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

def test(lst):
    return lst[0] if lst[1]<=T else 10**4

res = min(map(test, cr_list))
if not res <= 1000:
    res = 'TLE'

print(res)

Solution (Python):
def solve(string):
    n, t, *ct = map(int, string.split())
    c = [_c for _c, _t in zip(ct[::2], ct[1::2]) if _t <= t]
    return str(min(c)) if len(c) else "TLE"


if __name__ == '__main__':
    n, t = map(int, input().split())
    print(solve("{} {}\n".format(n, t) + "\n".join([input() for _ in range(n)])))

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

c_n=[]
t_n=[]
for i in range(n):
    if t[i]<=T:
        c_n.append(c[i])
        t_n.append(t[i])

if len(c_n)==0:
    print("TLE")
else:
    for i in range(len(c_n)):
        if c_n[i]==min(c_n):
            print(c_n[i])
            break

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

for i in range(N):
  c,t=map(int, input().split())
  if t<=T:
    C.append(c)
    
print(min(C) if len(C)!=1 else 'TLE')

Solution (Python):
n,t = map(int, input().split())
ans = 10**10
for _ in range(n):
  ci,ti=map(int, input().split())
  if ti<=t:
    ans = min(ans, ci)
if ans ==10**10:
  print("TLE")
else:
  print(ans)

Solution (Python):
A, B = map(int,input().split())
cost = list()
m = B + 1
for i in range(A):
  x, y = map(int, input().split())
  if y < m:
    cost.append(x)
print(min(cost) if len(cost) != 0 else 'TLE')

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

def kitaku(l):
  l.sort()
  for i in range(N):
    if l[i][1] <= T:
      return l[i][0]
    if i == N - 1:
      return "TLE"

print(kitaku(ct))

Solution (Python):






import numpy as np





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





if data[data[:,1] <= T].any():
    print(min(data[data[:,1] <= T][:,0]))
else:
    print("TLE")

Solution (Python):
a,b=map(int,input().split())
l=[]
for s in range(a):
  c,t=map(int,input().split())
  if t<=b:
    l.append(c)
if len(l)>0:
  print(min(l))
else:
  print("TLE")

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

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

Solution (Python):
n, t = map(int, input().split())
cn = [list(map(int, input().split())) for _ in range(n)]
cn.sort(key=lambda x: x[0])
m = 10e9
for c in cn:
    if c[1] <= t:
        m = min(m, c[0])

print('TLE' if m == 10e9 else m)

Solution (Python):


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

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

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

print(c_min if c_min != 1001 else 'TLE')