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:
A, B = map(int, input().split())
costlist=[]
exist=0
for i in range(A):
  c, t = map(int, input().split())
  if t<=B:
    costlist.append(c)
    exist=exist+1
if exist==0:
  kotae="TLE"
else:
  kotae=min(costlist)
print(kotae)

Submission status: Accepted

Solution code:
inpl = lambda: list(map(int,input().split()))
N, T = inpl()
costs = []
for i in range(N):
    c, t = inpl()
    if t <= T:
        costs.append(c)
if len(costs) > 0:
    print(min(costs))
else:
    print('TLE')

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
e=2000
for i in range(a):
    c,d=map(int, input().split())
    if d<=b:
        e=min(e,c)
print(e if e!=2000 else "TLE")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
from math import *
from itertools import *
from collections import *
from functools import *
try:
    from math import gcd
except Exception:
    from fractions import gcd


def solve(N: int, T: int, c: "List[int]", t: "List[int]"):
    ret = float('inf')
    for cc, tt in zip(c, t):
        if tt <= T:
            ret = min(ret, cc)
    return 'TLE' if ret == float('inf') else ret



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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,T = map(int,input().split())
CT = [list(map(int,input().split())) for _ in range(N)]
ans = 1001
for c,t in CT:
    if t <= T:
        ans = min(ans,c)
if ans == 1001:
    ans = 'TLE'
print(ans)

Submission status: Accepted

Solution code:
n,T=map(int, input().split())
b=[]
for i in range(n):
    p,q=map(int, input().split())
    if q<=T:
      b.append(p)
if b==[]:
  print('TLE')
else:
  print(min(b))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,T = map(int,input().split())
CT = [[int(i) for i in input().split()] for j in range(N)]
TL = 0 #Time limit
CT.sort(key = lambda x:x[1])

while CT[TL][1] <= T:
    TL += 1
    if TL == N:
        break
if TL == 0:
    print("TLE")
    exit()

CT_sort =sorted(CT[:TL])
print(CT_sort[0][0])

Submission status: Accepted

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

a.sort()
for i in a:
  if i[1] <= T:
    print(i[0])
    exit()

print('TLE')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, m = list(map(int,input().split()))
nums = [list(map(int,input().split())) for i in range(n)]
ans = 1e20
for c, t in nums:
  if t <= m:
    ans = min(c, ans)
if ans < 10000:
  print(ans)
else:
  print('TLE')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, T = map(int, input().split())
coti = [input().split() for i in range(N)]
#print(coti)
mincost = 1001
for pair in coti:
    #print(int(pair[1]))
    if int(pair[1]) <= T:
        if int(pair[0]) < mincost:
            mincost = int(pair[0])
        continue
if mincost == 1001:
    print('TLE')
else:
    print(mincost)

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,Time = map(int,input().split())
C = []
T = []
for i in range(N):
    c,t = map(int,input().split())
    if t <= Time:
        C.append(c)
        T.append(t)
if len(C) == 0:
    print("TLE")
else:
    print(min(C))

Submission status: Accepted

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

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

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

Submission status: Accepted

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

inf = 1 << 30
ans = inf

for i in range(n):
    c, x = map(int, input().split())
    
    if x <= t and ans > c:
        ans = c
        
if ans != inf:
    print(ans)
else:
    print("TLE")

Submission status: Accepted

Solution code:
N, T = map(int, input().split())
ct = sorted([list(map(int, input().split())) for _ in range(N)], key=lambda x: x[0])
# print(ct)

for i in range(N):
    if ct[i][1] <= T:
        print(ct[i][0])
        break
    else:
        if i == N - 1:
            print('TLE')

Submission status: Accepted

Solution code:
N, T = map(int,input().split())
CT = []
for i in range(N):
    L = list(map(int,input().split()))
    if L[1] <= T:
        CT.append(L)
if len(CT) == 0:
    print('TLE')
else:
    print(sorted(CT)[0][0])

Submission status: Accepted

Solution code:
N,T = map(int,input().split())
c = []
for i in range(N):
  ci,ti = map(int,input().split())
  c.append([ci,ti])

c.sort(key=lambda x:x[0])
for i in range(N):
  if c[i][1] <= T:
    print( c[i][0])
    exit()
print('TLE')

Submission status: Accepted

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

c = []
for i in range(N):
  ci,ti = map(int,input().split())
  c.append([ci,ti])
  
c.sort(key=lambda x:x[0])

for i in range(N):
  if c[i][1] <= T:
    print(c[i][0])
    exit()
print('TLE')

Submission status: Accepted

Solution code:
N, T = map(int, input().split())
 
c = []
for i in range(N):
    ci, ti = map(int, input().split())
    c.append([ci, ti])
 
c.sort(key=lambda x:x[0])
 
for i in range(len(c)):
    if c[i][1] <= T:
        print(c[i][0])
        exit()
print('TLE')

Submission status: Accepted

Solution code:
# ABC112B - Time Limit Exceeded
n, t = list(map(int, input().rstrip().split()))
data = [list(map(int, input().rstrip().split())) for _ in range(n)]
match = []

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

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

Submission status: Accepted

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

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

c.sort(key=lambda x:x[0])

for i in range(len(c)):
    if c[i][1] <= T:
        print(c[i][0])
        exit()
print('TLE')

Submission status: Accepted

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

*CTf, = filter(lambda ct: ct[1] <= T, CT)
if not CTf:
	print("TLE")
	exit()

minimum = min(CTf, key=lambda ct:ct[0])
print(minimum[0])

Submission status: Accepted

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

minimum = min(CT, key=lambda ct:[ct[0], 1001][not(ct[1] <= T)])
print([minimum[0], "TLE"][not(minimum[1] <= T)])

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

Submission status: Accepted

Solution code:
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)
m = 10000
for i in range(N):
    if t[i] <= T:
        m = min(m, c[i])

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

Submission status: Accepted

Solution code:
N, T = map(int, input().rstrip().split())
data = [list(map(int, input().rstrip().split())) for _ in range(N)]
data.sort(key=lambda x:x[0])
time = [i[1] for i in data]
cost = [i[0] for i in data]
answer = "TLE"
for i in range(N):
    if time[i] <= T:
        answer = cost[i]
        break
print(answer)

Submission status: Accepted

Solution code:
n,t=map(int,input().split())
cmin=1001
ans=1001
for i in range(n):
    ci,ti=map(int,input().split())
    if ti<=t and ci<=cmin:
        cmin=ci

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

m = 100000
for i in range(len(c)):
    if t[i]<= T:
        if m > c[i]:
            m = c[i]
if m == 100000:
    print("TLE")
else:
    print(m)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 20 12:13:24 2019

@author: Yamazaki Kenichi
"""

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

ans = 10**9
for c in A:
    if c[1] <= T:
        ans = min(ans,c[0])

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

Submission status: Accepted

Solution code:
#9:28〜9:40
N,T=map(int,input().split())
ctlistlist=[]
for n in range(N):
  ctlist=list(map(int,input().split()))
  if ctlist[1] <= T:
    ctlistlist.append(ctlist)
ctlistlist.sort()
if ctlistlist == []:
  print("TLE")
else:
  print(ctlistlist[0][0])

Submission status: Accepted

Solution code:
N,T=map(int,input().split())
C=[0]*N
NG=float('inf')
for i in range(N):
  c,t=map(int,input().split())
  if t <= T:
    C[i]=c
  else:
    C[i]=NG
if C.count(NG)==N:
  print('TLE')
else:
  print(min(C))

Submission status: Accepted

Solution code:
n,k = map(int,input().split())
tmp = 10000
for i in range(n):
    c,t = map(int,input().split())
    if k>=t:
        tmp = min(tmp,c)
if tmp==10000:
    print("TLE")
else:
    print(tmp)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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 if cost<1001 else "TLE")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# input
n, tc = map(int, input().split())
data = []
for i in range(n):
    c, t = map(int, input().split())
    data.append([c, t])

# process
cost = 1001
getroad = 0
for j in range(n):
    if data[j][1] <= tc:
        if cost > data[j][0]:
            cost = data[j][0]
            getroad += 1

# output
if getroad == 0:
    print("TLE")
else:
    print(cost)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

# cost = 10000000

INF = 10**4
cost = INF

# print(a)

# for i, risuto in enumerate(a):
#     if risuto[1] <= T:
#         if risuto[0] <= cost:
#             cost = risuto[0]

for i, risuto in enumerate(a):
    if risuto[1] <= T and  risuto[0] <= cost:
        cost = risuto[0]



# if cost == 10000000:

if cost == INF:
    cost = 'TLE'

print(cost)

Submission status: Accepted

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

cnt=0
ans =1000
for i in range(N):
    x =[int(j) for j in input().split()]
    
    if x[1]<=T:
        ans=min(ans,x[0])
        cnt+=1
if cnt>0:
    print(ans)
else:
    print('TLE')

Submission status: Accepted

Solution code:
n,tl = map(int,input().split())
cs = []
ts = []

for i in range(n):
  c, t = map(int,input().split())
  if t <= tl:
    cs.append(c)

min = 10000000
if len(cs) == 0:
  print('TLE')
else:
  for i in cs:
    if i < min:
      min = i
  print(min)

Submission status: Accepted

Solution code:
import sys
n,t = list(map(int, input().split()))
imincost=1001
for _ in range(n):
    c_,t_ = list(map(int, input().split()))
    if t_ <= t and c_ <imincost:
        imincost = c_
print(imincost if imincost != 1001 else "TLE")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
import sys

ans = sys.maxsize

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

if ans == sys.maxsize:
    print("TLE")
else:
    print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python
N, T = map(int, input().split())
B = [[int(i) for i in input().split()] for i in range(N)]

m = [e[0] for e in B if e[1] <= T]

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N, T = [int(elem) for elem in input().split()]
min_cost = None
min_cost_time = None
for i in range(0, N):
  c, t = [int(elem) for elem in input().split()]
  if t <= T:
    if min_cost is None:
      min_cost = c
      min_cost_time = t
    else:
      if c < min_cost:
        min_cost = c
        min_cost_time = t
if min_cost is None:
  print('TLE')
else:
  print(min_cost)

Submission status: Accepted

Solution code:
n,l=map(int,input().split())
ans=999999
for _ in range(n):
  c,t=map(int,input().split())
  if t<=l:
    if c<ans:
      ans=c
if ans==999999:
  print('TLE')
else:
  print(ans)

Submission status: Accepted

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

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

if num != 1001:
    print(num)
else:
    print('TLE')

Submission status: Accepted

Solution code:
n, t = map(int, input().split())
ct = []
for i in range(n):
    ct.append(list(map(int, input().split())))
num = 1001
has_tle = False

for i in range(n):
    if t >= ct[i][1]:
        if num >= ct[i][0]:
            num = ct[i][0]
        has_tle = True

if has_tle == True:
    print(num)
else:
    print('TLE')

Submission status: Accepted

Solution code:
n, l = map(int, input().split())
c = []
t = []

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

args = []
for i in range(n):
    if t[i] <= l:
        args.append(i)

possibleTimes = []
for i in args:
    possibleTimes.append(c[i])

print("TLE" if possibleTimes == [] else min(possibleTimes))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,T=map(int,list(input().split()))
c=1001
for i in range(N):
  ct,tc=map(int,list(input().split()))
  if T>=tc and c>=ct:
    c=ct
if c==1001:
  c="TLE"
print(c)

Submission status: Accepted

Solution code:
n, t_limit = map(int, input().split())
cts = [list(map(int, input().split())) for _ in range(n)]
min_c = 10000
for c, t in cts:
    if t <= t_limit and c < min_c:
        min_c = c
if min_c == 10000:
    print('TLE')
else:
    print(min_c)

Submission status: Accepted

Solution code:
N,T=map(int,input().split())
cost=10**3
ans=0
for i in range(N):
  c,t=map(int,input().split())
  if t<=T:
    if c<=cost:
      cost=c
      ans=i+1
if ans==0:
  print("TLE")
else:
  print(cost)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys


def solve(N: int, T: int, c: "List[int]", t: "List[int]"):
    ret = float('inf')
    for i in range(N):
        if t[i] <= T:
            ret = min(ret, c[i])
    if ret == float('inf'):
        print('TLE')
    else:
        print(ret)
    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))  # type: int
    T = int(next(tokens))  # type: int
    c = [int()] * (N)  # type: "List[int]" 
    t = [int()] * (N)  # type: "List[int]" 
    for i in range(N):
        c[i] = int(next(tokens))
        t[i] = int(next(tokens))
    solve(N, T, c, t)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

cost = []
for i in range(n):
    x , y = map(int,input().split())
    if y > t:
        pass
    else:
        cost.append(x)

        
print('TLE' if len(cost) == 0 else min(cost))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import copy
from bisect import bisect_left

def main():
	N, T = map(int, input().split(" "))
	CT = []
	isOK = False
	for _ in range(N):
		c, t = map(int, input().split(" "))
		if t <= T:
			isOK = True
			CT.append((c, t))
	
	if isOK == False:
		print("TLE")
		sys.exit()
	
	CT.sort()
	c, t = CT[0]
	print(c)
	
	
if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
N,T=map(int, input().split())
m = min([c if t <= T else 9999 for c,t in [map(int, input().split()) for _ in range(N)]])
print("TLE" if m==9999 else m)

Submission status: Accepted

Solution code:
N, T = map(int, raw_input().split())
ans = 'TLE'
for i in range(0, N):
	c, t = map(int, raw_input().split())
	if t <= T:
		if ans == 'TLE':
			ans = str(c)
		elif c < int(ans):
			ans = str(c)
print ans

Submission status: Accepted

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

answer = 'TLE'
INF = 100000000
min_cost = INF

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

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

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

Submission status: Accepted

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

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

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

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

Submission status: Accepted

Solution code:
n, t = map(int, input().split())
ct = [list(map(int, input().split())) for _ in range(n)]
sorted = sorted(list(filter(lambda x: x[1] <= t, ct)))

if sorted == []:
    print("TLE")
else:
    print(sorted[0][0])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

# cost = 10000000

INF = 10**4
cost = INF

# print(a)

# for i, risuto in enumerate(a):
#     if risuto[1] <= T:
#         if risuto[0] <= cost:
#             cost = risuto[0]

for i, risuto in enumerate(a):
    if risuto[1] <= T and  risuto[0] <= cost:
        cost = risuto[0]



# if cost == 10000000:

if cost == INF:
    cost = 'TLE'

print(cost)

Submission status: Accepted

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

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

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

cost = 10000000

# print(a)

for i, risuto in enumerate(a):
    if risuto[1] <= T:
        if risuto[0] <= cost:
            cost = risuto[0]

if cost == 10000000:
    cost = 'TLE'

print(cost)

Submission status: Accepted

Solution code:
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 = 1001

for i in range(N):
    if t[i] <= T and c[i] < cost:
        cost = c[i]

if cost <= 1000:
    print(cost)
else:
    print('TLE')

Submission status: Accepted

Solution code:
def main():
	n, t = map(int, input().split())
	possible_home = False
	min_cost = 10**9
	for _ in range(n):
		c, ti = map(int, input().split())
		if ti <= t:
			possible_home = True
			if c < min_cost:
				min_cost = c

	if possible_home:
		print(min_cost)
	else:
		print("TLE")


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, T = map(int, input().split())
root = [list(map(int, input().split())) for i in range(N)]
minc = 1001
for c, t in root:
    if t <= T:
        if c <= minc:
            minc = c
if minc == 1001:
    minc = 'TLE'
print(minc)

Submission status: Accepted

Solution code:
n,t = map(int,input().split())
l = []
tmpcost = 1001
for i in range(n):
  l.append([int(x) for x in input().split()])
#print(l)
for i in range(n):
  if l[i][1] <= t and l[i][0] <= tmpcost:
    tmpcost = l[i][0]
if tmpcost == 1001:
  print("TLE")
else:
  print(tmpcost)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,t=map(int,input().split())
c=10**9
for i in range(n):
    ci,ti=map(int,input().split())
    if ti<=t and ci<c:
        c=ci
if c==10**9:
    print("TLE")
else:
    print(c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, T = map(int, input().split())
c_t = []
for i in range(N):
    c_t.append(list(map(int, input().split())))
c_t.sort()
min_cost = 10000
for i in range(N):
    if c_t[i][1] <= T and c_t[i][0] < min_cost:
        min_cost = c_t[i][0]
if min_cost > 1000:
    print('TLE')
else:
    print(min_cost)

Submission status: Accepted

Solution code:
n,T = list(map(int,input().split()))
c = [0]*n
t = [0]*n
cmin = 1001
for i in range(0,n):
    c[i],t[i] = list(map(int,input().split()))
    if t[i] <= T:
        cmin = min(cmin,c[i])

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

Submission status: Accepted

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

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

m = sorted(m)
if len(m) == 0:
    print('TLE')
else:
    print(m[0])

Submission status: Accepted

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

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

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

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

Submission status: Accepted

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

# 最小コストの経路の番号
x = None
# 最小コスト
min = float('inf')

for c,t in HOME_PATH:
  if t <= T and c < min:
    x = t
    min = c
if min == float('inf'):
  print('TLE')
else:
  print(min)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N,T = map(int, input().split())
ct = [list(map(int, input().split())) for i in range(N)]
s_ct = sorted(ct)

for item in s_ct:
    if item[1] <= T:
        print(item[0])
        exit()

print('TLE')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N, T = map(int, input().split())
path_list = [list(map(int, input().split())) for _ in range(N)]
min_cost = 1001
for path in path_list:
	if T >= path[1] and path[0] < min_cost:
		min_cost = path[0]
print(min_cost if min_cost < 1001 else 'TLE')

Submission status: Accepted

Solution code:
import numpy as np
n, t = map(int, raw_input().split())
c = []
for i in range(n):
	c.append(map(int, raw_input().split()))
c = np.array(c)
y, x = c.shape
for i in range(y):
	if c[i,1] > t:
		c[i,0] = 9999
if min(c[:,0]) < 9999:
	print min(c[:,0])
else:
	print 'TLE'

Submission status: Accepted

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

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

min = 1001
for x, y in a:
  if x < min and y <= t:
    min = x

print(min if min < 1001 else "TLE")

Submission status: Accepted

Solution code:
n,t=map(int,input().split())
a=[]
b=[]
for i in range(n):
  s,u=map(int,input().split())
  a.append(s)
  b.append(u)
c=[]
for j in range(n):
  if b[j]>t:
    c.append(1001)
  else:
    c.append(a[j])
if c==[1001]*n:
  print('TLE')
else:
  print(min(c))

Submission status: Accepted

Solution code:
N, T = map(int,input().split())
ct = [[int(i) for i in input().split()]for i in range(N)]
res = 100000
for c, t in ct:
  if t > T:
    continue
  else:
    res = min(res, c)
if res == 100000:
  res = 'TLE'
print(res)

Submission status: Accepted

Solution code:
n,t = map(int,input().split())
ct_list = [list(map(int,input().split())) for _ in range(n)]
res = []
for c,time in ct_list:
    if time <= t:
        res.append(c)
print(min(res) if len(res)!=0 else 'TLE')

Submission status: Accepted

Solution code:
n,t = map(int,input().split())
ans_cost = 10000

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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