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):
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
N, T = M()
ans = 100000
for _ in range(N):
    c, t = M()
    if t <= T:
        ans = min(ans, c)
if ans == 100000:
    print('TLE')
else:
    print(ans)

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

Solution (Python):
s = input().split()

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

arrays = []

for i in range(n):
    v = input().split()
    w = int(v[1])
    if w <= t:
        arrays.append(int(v[0]))

arrays.sort()
if len(arrays) == 0:
    print('TLE')
else:
    answer = arrays[0]
    print(answer)

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

for _ in range(N):
    c_, t_ = map(int, input().split())
    c.append(c_)
    t.append(t_)

for i in range(N):
    if t[i] <= T:
        if c[i] < min_cost:
            min_cost = c[i]
            
if min_cost != 1001:
    print(min_cost)
else:
    print('TLE')

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

ans = 10**9

for i in range(n):
  c,y = map(int,input().split())
  if y<=t:
    ans = min(ans,c)
    
if ans == 10**9:
  print("TLE")
else:
  print(ans)

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

Solution (Python):
N,Limit = (int(T) for T in input().split())
Flag = False
CostMax = 1001
for R in range(0,N):
    Cost,Time = (int(T) for T in input().split())
    if Time<=Limit and Cost<CostMax:
        CostMax = Cost
        Flag = True
print(['TLE',CostMax][Flag])

Solution (Python):
n,t=map(int,input().split())
d={i:j for i,j in [list(map(int,input().split())) for _ in range(n)] if j<=t}
print(sorted(d.items(),key=lambda x:x[0])[0][0] if d else'TLE')

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

Solution (Python):
n, t = map(int, input().split())
min_cost = float('inf')
for _i in range(n):
  cost, time = map(int, input().split())
  if time <= t and cost <= min_cost:
    min_cost = cost

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

Solution (Python):

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

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

c=[]
for i in range(n):
  c_=list(map(int,input().split()))
  c.append(c_)
  
c.sort()

for i in range(n):
  if c[i][1]<=t:
    print(c[i][0])
    exit()
    
  else:
    continue
    
print('TLE')

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


if __name__ == "__main__":
    main()

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

c=[]
for i in range(n):
  c_=list(map(int,input().split()))
  c.append(c_)
  
c.sort()

for i in range(n):
  if c[i][1]<=t:
    print(c[i][0])
    exit()
    
  else:
    continue
    
print('TLE')

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

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

Solution (Python):
def main():
    N, T = map(int, input().split())
    l = []
    cost = 1001
    for i in range(N):
        l.append(list(map(int, input().split())))
    for i in range(N):
        if l[i][1] <= T:
            t = l[i][1]
            if l[i][0] < cost:
                cost = l[i][0]
    if cost == 1001:
        print('TLE')
    else:
        print(cost)
main()

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

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

Solution (Python):
N,T = list(map(int,input().split()))
ct = []
for i in range(N):
    ct.append(list(map(int,input().split())))
minCost = 1001
for i in range(N):
    if ct[i][1] <= T and minCost > ct[i][0]:
        minCost = ct[i][0]
if minCost > 1000:
    print("TLE")
else:
    print(minCost)

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

Solution (Python):
MM = input().split()
N = int(MM[0])
T = int(MM[1])
list1 =[]
for i in range(N):
  NN = input().split()
  c = int(NN[0])
  t = int(NN[1])
  if t <= T:
    list1.append(c)
list1.sort()
if len(list1) == 0:
  print('TLE')
else:
  print(list1[0])

Solution (Python):
n, t = map(int, input().split())
minN = 10000
for i in range(n):
  c, ti = map(int, input().split())
  if t >= ti and minN > c:
    minN = c
print("TLE" if minN == 10000 else minN)

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

ct = [i[0] for i in ct if i[1]<=t]
if not ct:
    print('TLE')
else:
    print(min(ct))

Solution (Python):







































































def calculation(lines):
    
    N, T = list(map(int, lines[0].split()))
    

    min_c = None

    for i in range(1, N+1):
        c, t = list(map(int, lines[i].split()))
        if t <= T:
            if min_c is None:
                min_c = c
            elif min_c > c:
                min_c = c

    if min_c is None:
        return ['TLE']
    else:
        return [min_c]



def get_input_lines():
    line = input()
    values = list(map(int, line.split()))
    N = values[0]
    lines = list()
    lines.append(line)
    for _ in range(N):
        lines.append(input())
    return lines



def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['3 70', '7 60', '1 80', '4 50']
        lines_export = [4]
    if pattern == 2:
        lines_input = ['4 3', '1 1000', '2 4', '3 1000', '4 500']
        lines_export = ['TLE']
    if pattern == 3:
        lines_input = ['5 9', '25 8', '5 9', '4 10', '1000 1000', '6 1']
        lines_export = [5]
    return lines_input, lines_export



def get_mode():
    import sys
    args = sys.argv
    if len(args) == 1:
        mode = 0
    else:
        mode = int(args[1])
    return mode



def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines()
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    
    
    
    
    
    
    
    
    
    
    



if __name__ == '__main__':
    main()

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

Solution (Python):
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N, T = LI()
    ct = [LI() for _ in range(N)]

    l = [i[0] for i in ct if i[1] <= T]

    if l:
        print(min(l))
    else:
        print('TLE')

if __name__ == '__main__':
    resolve()

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n, t = map(int, readline().split())
cost = 9999
for i in range(n):
    inpt = list(map(int, readline().split()))
    if inpt[1] <= t:
        cost = min(cost, inpt[0])
print(cost if cost != 9999 else 'TLE')

Solution (Python):
n = list(map(int, input().split()))
x = [list(map(int, input().split())) for i in range(n[0])]
ans = []
for i in x:
  if n[1] >= i[1]:
    ans.append(i[0])
if ans == []:
  print('TLE')
else:
  print(sorted(ans)[0])

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

ans = []
for i in range(len(grid)):
    if grid[i][1] <= T:
        ans.append(grid[i])

if len(ans) != 0:
    print(sorted(ans)[0][0])
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 c<ans:
        ans=c
print("TLE" if ans==1001 else ans)

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

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

ans = 10000

for i in range(n):
    cost,time = map(int,input().split())
    
    if time <= lim and cost < ans:
        ans = cost

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

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:
        min_cost = min(min_cost, c)

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

Solution (Python):
n, t = map(int, input().split())
ct = [list(map(int, input().split())) for i in range(n)]
ans = 10 ** 10
cnt = 0
for i in range(n):
  if ct[i][1] <= t:
    ans = min(ans, ct[i][0])
    cnt += 1
if cnt > 0:
  print(ans)
else:
  print("TLE")

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

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

print([cost, "TLE"][cost == 1001])

Solution (Python):

from bisect import bisect_right
import sys
input = sys.stdin.readline  
N,T = (int(i) for i in input().split())
cost_time =[]
time =[]
for i in range(N):
    c,t = (int(j) for j in input().split())
    cost_time.append((c,t))
    time.append(t)


time.sort()
ind =bisect_right(time,T)
if ind ==0:
    ans ="TLE"
else:
    cost_time.sort(key =lambda x:x[1])
    ans1 =[]
    for i in range(ind):
        ans1.append(cost_time[i][0])
    ans =min(ans1)    
print(ans)

Solution (Python):


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

for i in range(N):
    A,B = map(int,input().split())
    C.append(A)
    D.append(B)
if min(D) > T:
    print('TLE')
else :
    F=[]
    for i in range(N):
        if D[i] <= T:
            F.append(C[i])
    print(min(F))

Solution (Python):

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

ans = float("inf")

for i in range(N):
	if CT[i][1] <= T:
		ans = min(ans, CT[i][0])
	else:
		pass

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

print(ans)

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

ans = 10**6
for n in range(N):
  if ct[n][1] <= T:
    if ct[n][0] <= ans:
      ans = ct[n][0]
if ans != 10**6:
  print(ans)
else:
  print("TLE")

Solution (Python):
mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

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


if __name__ == '__main__':
    main()

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

Solution (Python):


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

intime = [ct[0] for ct in CT if ct[1]<=T]
if len(intime)==0:
    print("TLE")
else:
    print(min(intime))

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

Solution (Python):
import math
def main():
  n,time = list(map(int,input().split()))
  ct = [map(int, input().split()) for _ in range(n)]
  c,t = [list(i) for i in zip(*ct)]
  cost=1001
  for i in range(0,n):
    if t[i]<=time and c[i]<cost:
      cost=c[i]
  if cost==1001:
    print("TLE")
  else:
    print(cost)
main()

Solution (Python):
n,T = map(int,input().split())
c = 500000
for i in range(n):
    a,b = map(int,input().split())
    if T >= b:
        c = min(c,a)
print(c if c < 500000 else 'TLE')

Solution (Python):


import copy
import random
import bisect 
import fractions 
import math
import sys
import collections
from decimal import Decimal 

mod = 10**9+7
sys.setrecursionlimit(mod) 

d = collections.deque()
def LI(): return list(map(int, sys.stdin.readline().split()))

N, T = LI()
costs = []
for i in range(N):
    c, t = LI()
    if t <= T:
        costs.append(c)

if len(costs) > 0:

    costs.sort()
    print(costs[0])
else:
    print("TLE")

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

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

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

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

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

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

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

INF = 2000
cost = INF 
for i in range(n):
    c, time = map(int, input().split())
    if t >= time:
        cost = min(cost, c)

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

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

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

Solution (Python):
def solve():
    n, k = map(int, input().split())
    res = 10**10
    for i in range(n):
        a, b = map(int, input().split())
        if b <= k:
            res = min(res, a)
    print(res if res != 10**10 else "TLE")


solve()

Solution (Python):
N, T = map(int, input().split())
ans = 10**5
for i in range(N):
    a, b = map(int, input().split())
    if b <= T:
        ans = min(ans, a)
if ans is 10**5: print('TLE')
else: print(ans)

Solution (Python):


import math

import itertools
from collections import deque
from collections import Counter



import bisect
n,T=map(int,input().split())
ans=10000
for i in range(n):
    c,t=map(int,input().split())
    if t>T:
        continue
    if c<ans:
        ans=c
if ans==10000:
  print("TLE")
else:
  print(ans)

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

c_ans = float('inf')
for ct in cts:
    if ct[1] <= t:
        c_ans = min(c_ans, ct[0])
if c_ans == float('inf'):
    print('TLE')
else:
    print(c_ans)

Solution (Python):
def main():
    N, T = map(int, input().split())
    C = []
    for _ 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))


if __name__ == '__main__':
    main()

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

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

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

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

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

all_pattern_list = []

for i in range(N):
    all_pattern_list.append([int(j) for j in input().split()])  

INF = 1001
ans = INF  

for c, t in all_pattern_list:  
    if t <= T:
        ans = min(ans, c)  

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

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

for i in range(N):
  all_pattern_list.append([int(j) for j in input().split()])

INF = 1001
ans = INF  

for c, t in all_pattern_list:  
  if t <= T:
    ans = min(ans, c)  

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

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

all_pattern_list = sorted(list(zip(*[iter(all_list)]*2)))

for pattern in all_pattern_list:
    if pattern[1] <= int(T):
        print(pattern[0])
        break
    elif pattern == all_pattern_list[-1]:
        print('TLE')

Solution (Python):
def resolve():
    N, T = list(map(int, input().split()))
    CT = sorted([list(map(int, input().split())) for _ in range(N)], key=lambda x: x[0])
    for cost, time in CT:
        if time > T:
            continue
        print(cost)
        break
    else:
        print("TLE")



if '__main__' == __name__:
    resolve()

Solution (Python):
N,T = map(int,input().split())
array = []
array = [ [lista for lista in map(int,input().split())] for I in range(N) ]

min = 1001
for I in array:
    if I[1] > T:
        continue
    elif I[1] <= T:
        if I[0] < min: min = I[0]
print(min) if min < 1001 else print('TLE')

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

cost = 100000

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

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

Solution (Python):
import math
inf = float('inf')

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

min_c = inf
for i in c_t:
    if i[1] <= t:
        min_c = min(min_c, i[0])

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

Solution (Python):
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

n, t = rm()
min_ = inf
flag = False
for _ in range(n):
  a, b = rm()
  if b <= t:
    min_ = min(min_, a)
    flag = True
if flag:
  print(min_)
else:
  print('TLE')

Solution (Python):
n,ct = map(int, raw_input().split(' '))
m = min([u for u,v in [map(int,raw_input().split()) for _ in range(n)] if v <= ct] or [+float('inf')])
print 'TLE' if m == +float('inf') else m

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

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

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

Solution (Python):
def main():
    n,t=map(int,input().split())
    ct=[tuple(map(int,input().split())) for _ in range(n)]
    minc = 1001
    for c,tt in ct:
        if t >= tt and minc > c:
            minc = c
    print(minc if minc != 1001 else "TLE")

if __name__ == "__main__":
    main()

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:
        min_cost=min(min_cost,c)
print("TLE" if min_cost==1001 else min_cost)

Solution (Python):
n,T=map(int,input().split())
la=[]
for i in range(n):
    c,t=map(int,input().split())
    if t<=T:la+=[(c,t)]
la=sorted(la,key=lambda x:x[0])
print("TLE" if la ==[] else la[0][0])

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

ans = -1
cost = 10**5

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

print(cost if ans != -1 else "TLE")

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

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

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

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

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

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

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

Solution (Python):
C=list()
T=list()
N,T=map(int,input().split())
for i 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):
n,t=map(int,input().split())
ans=1000000
for i in range(n):
  x,y=map(int,input().split())
  if y<=t:
    ans=min(ans,x)
if ans<=100000:
  print(ans)
else:
  print("TLE")

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('TLE' if len(C) == 0 else min(C))

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

di = dict(l)

keys = [k for k, v in di.items() if v <=T]

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

Solution (Python):


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

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

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



for i in ct:
    if i[1] <= t:
        print(i[0])
        exit()

print("TLE")

Solution (Python):
n, t = map(int, input().split())
lst = []
for i in range(n):
  tp = tuple(map(int, input().split()))
  if tp[1] <= t:
    lst.append(tp)
if lst == []:
  print('TLE')
  exit()
print(min(lst, key=lambda x: x[0])[0])

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

Solution (Python):
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
INF = 10**9
mod = 10**9+7

N,T = I()
ans = INF
for i in range(N):
    c,t = I()
    if t <= T:
        ans = min(ans,c)
if ans == INF:
    print('TLE')
else:
    print(ans)

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

for n 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())
X = [list(map(int, input().split())) for _ in range(N)]
Y = [x for x in X if x[1]<=T]
Z = [y[0] for y in Y]
print("TLE" if Y==[] else min(Z))

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

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

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

N, T = MI()
ct = []

for _ in range(N):
    c, t = MI()
    ct.append([c, t])
    
ct.sort(key = lambda x : x[0])
flg = False
ans = 0

for i in range(N):
    if ct[i][1] <= T:
        ans = ct[i][0]
        flg = True
        break
        
print(ans if flg else "TLE")

Solution (Python):
n,time=map(int,input().split())
c=[]
t=[]
for i in range(n):
    a,b=map(int,input().split())
    c.append(a)
    t.append(b)
ans=10**10
for i in range(n):
    if t[i]<=time:
        ans=min(ans,c[i])

print(ans if ans!=10**10 else "TLE")

Solution (Python):
import sys
read = sys.stdin.read
readline = sys.stdin.buffer.readline
INF = float('inf')


def main():
    N, T = map(int, readline().split())
    ans = INF

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

    if ans == INF:
        print('TLE')
    else:
        print(ans)
if __name__ == '__main__':
    main()

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):
N,T = map(int,input().split())
record = [map(int,input().split()) for i in range(N)]
record2 = [i  for i,j in record if j<=T]
print(min(record2) if len(record2)!=0 else "TLE")

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

for i in range(n):
    if c[i][1] <= t:
        p.append(c[i][0])

if len(p) == 0:
    print('TLE')
else:
    p.sort()
    print(p[0])

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

index = -1
min_c = 9999
for i in range(n):
    c, t = map(int, input().split())
    
    
    if t <= T and min_c > c:
        index = i + 1
        min_c = c
    
        
if index == -1:
    print('TLE')
else:
    print(min_c)

Solution (Python):
n,T = map(int,input().split())
ct = [map(int, input().split()) for _ in range(n)]
c,t = [list(i) for i in zip(*ct)]
ans = 1000000
for i in range(n):
  if(T >= t[i]):
    ans = min(ans,c[i])
if(ans == 1000000):
  print('TLE')
else:
  print(ans)

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

Solution (Python):
def solve():
    n, T = map(int, input().split())
    ans = 10000
    for _ in range(n):
        c, t = map(int, input().split())
        if t <= T:
            ans = min(c, ans)
    if ans == 10000:
        print('TLE')
    else:
        print(ans)


if __name__ == '__main__':
    solve()

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

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

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

Solution (Python):
N, T, *_CT = map(int, open(0).read().split())
CT = list(zip(*[iter(_CT)]*2))

costs = [ct[0] for ct in CT if ct[1] <= T]
if costs == []:
    print("TLE")
else:
    print(min(costs))

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

Solution (Python):
a,b=map(int,input().split())
c=[]
for _ in range(a):
    c.append(list(map(int,input().split())))
result=[]
for i in range(a):
    if c[i][1]<=b:
        result.append(c[i][0])
if result==[]:
    print('TLE')
    exit()
print(min(result))

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

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

Solution (Python):
import sys
input = lambda: sys.stdin.readline().rstrip()

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

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

print(ans if ans != 10**10 else "TLE")

Solution (Python):
N,T = map(int,input().split())
ct = [list(map(int,input().split())) for j in range(N)]
box = []
for i in range(N):
	if ct[i][1] <= T:
		box.append(ct[i])
if box ==[]:
	print("TLE")
else:
	box.sort(key=lambda x:x[0])
	print(box[0][0])

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

Solution (Python):
f=lambda:map(int,input().split())
n,T=f()
m=min([1001]+[c for c,t in [f() for _ in range(n)] if t<=T])
print([m,'TLE'][m>1000])

Solution (Python):
f=lambda:map(int,input().split())
n,T=f()
m=1001
for _ in range(n):
  c,t=f()
  if t<=T: m=min(m,c)
print([m,'TLE'][m>1000])

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

ans = 1001
for i,j in c:
  if j <= t:
    ans = min(ans,i)

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