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



Sample input:
3 70
7 60
1 80
4 50


Sample output:
4

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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])

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#112B
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")

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
# encoding: utf-8
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)

Submission status: Accepted

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

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

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


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

    return r


print(main())

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-


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()

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
#!/usr/bin/env pypy3


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()

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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"

Submission status: Accepted

Solution code:
#abc112b

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]

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
[N, T] = [int(i) for i in input().split()]
cmin = 1001
for _ in range(N):
    [c, t] = [int(i) for i in input().split()]
    if t <= T and c <= cmin:
        cmin = c
if cmin == 1001:
    print('TLE')
else:
    print(cmin)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
# cording:utf-8
# Nをn Tをt_limitとして整数で入力
n,t_limit = (int(x) for x in input().split())
# ci,tiのリストを作っておく
cost_list = list()
time_list = list()
# n回繰り返す
while n >= 1:
    ci,ti = (int(x) for x in input().split())
    if ti <= t_limit:   #tiがTを超えないとき
        cost_list.append(ci)    #cost_listにciを追加する
        time_list.append(ti)    #time_listにtiを追加する
        n = n - 1
    else:
        n = n - 1
if not time_list:   #time_listが空の時
    print('TLE')
else:
    print(min(cost_list))

Submission status: Accepted

Solution code:
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)])

Submission status: Accepted

Solution code:
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])

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
num, time = map(int, input().split(' '))
# print(num, time)

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))

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
# 2 * N の配列 https://beta.atcoder.jp/contests/abc034/submissions/2638960
''' こんな感じ
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
'''

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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])

Submission status: Accepted

Solution code:
A=[]
while True:
    try:
        A.append(list(map(int,input().split())))
              
 
    except:
        break;
#2列めがT以下で且つ、コストが最小なものを抽出
T = A[0][1]
Tc = 0
min = A[1][0] #最小を7とす
 
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)

Submission status: Accepted

Solution code:
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=lambda x:x[1])
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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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 i>len(t):
            #break
        
    

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

print(min(c))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# cording:utf-8
n,t_limit = (int(x) for x in input().split())
cost_list = list()
time_list = list()
while n >= 1:
    c,tn = (int(x) for x in input().split())
    if tn <= t_limit:
        cost_list.append(c)
        time_list.append(tn)
        n = n - 1
    else:
        n = n - 1
if not time_list:
    print('TLE')
else:
    best_cost = min(cost_list)
    print(best_cost)

Submission status: Accepted

Solution code:
line = input().split(" ")
N = int(line[0])
T = int(line[1])

c = []
t = []
for i in range(N):
    line = input().split(" ")
    if T >= int(line[1]):
        c.append(line[0])
        t.append(line[1])

if len(c) == 0:
    print('TLE')
    exit()
elif len(c) == 1:
    print(int(c[0]))
    exit()
elif len(c) >= 2:
    ans = int(c[0])
    for i in range(len(c)-1):
        if ans > int(c[i+1]):
            ans = int(c[i+1])
print(ans)

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    N, T = map(int,input().split(' '))
    c = []
    t = []
    for i in range(N):
        c1, t1 = [int(i) for i in input().split(' ')]
        c.append(c1)
        t.append(t1)

    min = "None"
    for i in range(N):
        if T >= t[i]:
            if min == "None":
                min = c[i]
            else:
                if min > c[i]:
                    min = c[i]
    if min == "None":
        print("TLE")
    else:
        print(min)

Submission status: Accepted

Solution code:
import numpy as np

dataNum, timeMax = input().strip().split(' ')
dataNum, timeMax = [int(dataNum), int(timeMax)]

cost = [10000]
time = [10000]

"""
for i in range(dataNum):
    A, B = list(map(int, input().strip().split(' ')))   
    cost.append(A)
    time.append(B)

if min(time) > timeMax:
    print('TLE')
else :
    print(min(cost))
"""
for i in range(dataNum):
    A, B = list(map(int, input().strip().split(' ')))   
    if B <= timeMax:
        cost.append(A)
        time.append(B)
    
if min(time) > timeMax:
    print('TLE')
else :
    print(min(cost))

Submission status: Accepted

Solution code:
N, T = map(int, input().split())
dic = {}
for i in range(0,N):
    cost, time = map(int, input().split())
    dic[cost] = time
result = 1001
for cost, time in dic.items():
    if time <=T :
        if result >= cost:
            result = cost
if result == 1001:
    print("TLE")
else:
    print(result)

Submission status: Accepted

Solution code:
#-*- coding:utf-8 -*- 

def main():
	N, T = map(int,input().split())
	c_list = []
	t_list = []
	for i in range(N):
		c, t = map(int,input().split())
		c_list.append(c)
		t_list.append(t)
	
	#print(t_list)
	#print(type(t_list[0]))
	index_list = []
	for i in range(len(t_list)):
		if t_list[i] <= T:
			index_list.append(i)
	
	#print(index_list)
	
	if len(index_list) == 0:
		return print("TLE")

	cost_min = float("inf")
	for i in index_list:
		if c_list[i] < cost_min:
			cost_min = c_list[i]
	
	print(int(cost_min))
	

if __name__ == "__main__":
	main()

Submission status: Accepted

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

mic=1001
for i in range(n):
    if A[i][1]<=t :
        mic=min(mic,A[i][0])

if mic<1001 :
    print(mic)
else:
    print("TLE")

Submission status: Accepted

Solution code:
# coding:utf-8

from operator import itemgetter

n, t = map(int, raw_input().split())
ans = 0
i=0
# l = [[0], [0]]*n
l = [[0 for i in range(2)] for j in range(n)]

# print l

for i in range(0, n):
    a, b = map(int, raw_input().split())
    l[i][0] = a
    l[i][1] = b
    
# print l
l.sort(key=itemgetter(1))
# print l

if t < l[0][1]:
    print "TLE"
else:
    ans = l[0][0]
    for i in range(n):
        if l[i][1] > t:
            break
        if l[i][0] < ans:
            ans = l[i][0]
    print ans

Submission status: Accepted

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

listA=[] #appendのために宣言が必要
for i in range(N):
    a,b=input().split()
    listA.append([int(a), int(b)])

for i in range(len(listA)):
    if(T<listA[i][1]):
        listA[i][0]=9999

minc=9999
index=9999
for i in range(len(listA)):
    if(minc>listA[i][0]):
        minc=listA[i][0]
        index=i
if(minc==9999):
    print('TLE')
    exit(0)
print(minc)

Submission status: Accepted

Solution code:
"""
N, M = map(int, input().split( ))
a = []
for i in range(2):
    a.append(map(int, input().split( )))
print (a) 
# [[a11, a12, a13, ..., a1M]
#  [a21, a22, a23, ..., a2M]
#  ...
#  [aN1, aN2, aN3, ..., aNM]]
"""

result = 1001
A = input().split()
N = int(A[0])
T = int(A[1])
e =[]
e = [[i for i in input().split()] for i in range(N)] 

for i in range(N):
    if int(e[i][1]) <= T:
        temp = int(e[i][0])
        if result >int(e[i][0]): 
            result = int(e[i][0])

if result ==1001:
    result ="TLE"

print(result) 
#print(e[0][0])
#print(T)

Submission status: Accepted

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

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

TLE=0

for j in range(N):
    if TT[j]>T:
        TLE= TLE+1
    else:
        pass
    
if TLE==N:
    print("TLE")

else:   
    ans=max(C)

    for k in range(N):
        if TT[k]>T:
            pass
        elif C[k]<ans:
            ans=C[k]

    print(ans)

Submission status: Accepted

Solution code:
import numpy as np

N, T = input().split()
N = int(N)
T = int(T)
c = np.zeros(N)
t = np.zeros(N)
for i in range(N):
    cc, tt = input().split()
    c[i] = int(cc)
    t[i] = int(tt)
if (t < T).sum() > 0:
    n = np.min(c[t <= T])
    print(int(n))
else:
    print("TLE")