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=map(int,input().split())
ct=[tuple(map(int,input().split())) for i in range(N)]
ans=10**9
for c,t in ct:
    if T<t:
        continue
    else:
        ans=min(ans,c)
print(ans if ans!=10**9 else 'TLE')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

keep_cost = 1001

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


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

Submission status: Accepted

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

keep_cost = 1001
taken_t = 1001
for i in range(n):
    c,t = map(int, input().split())
    if T >= t:
        if c <= keep_cost:
            keep_cost = c
            taken_t = t

print(keep_cost if taken_t <= T else "TLE")

Submission status: Accepted

Solution code:
import sys
from bisect import *
from collections import *
from copy import deepcopy
from datetime import *
from heapq import *
from itertools import *
# from math import *
from operator import *
from pprint import *

sys.setrecursionlimit(10**8)

input = sys.stdin.readline

def main():
    """ main """
    N,T = map(int, input().split())
    ans = float('inf')
    for _ in range(N):
        c,t = map(int, input().split())
        if t > T: continue
        ans = min(ans, c)

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline


def main():
    N, T = map(int, input().split())

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

 
if __name__ == '__main__':
    main()

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:
		if c < cost:
			cost = c

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

Submission status: Accepted

Solution code:
N,T=map(int,input().split())
CT=[]
for i in range(N):
    CT.append(list(map(int,input().split())))
CT=sorted(CT,key=lambda x:x[1],reverse=True)

C=1001
for i in range(N):
    if CT[i][1] <= T:
        C=min(C,CT[i][0])

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

Submission status: Accepted

Solution code:
n, t = map(int, input().split())
c = [input().split() for _ in range(n)]
c_sorted = sorted(c, key=lambda i:int(i[0]))
for i in range(n):
    if int(c_sorted[i][1]) <= t:
        print(c_sorted[i][0])
        exit()
    else:
        pass
print('TLE')

Submission status: Accepted

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

result = []
for i in range(n):
    if ans[i][1] <=T:
        result.append(ans[i][0])
    else:
        result.append(1000000)
if min(result) == 1000000:
    print('TLE')
else:
    print(min(result))

Submission status: Accepted

Solution code:
N,T = list(map(int,input().split()))
C = [list(map(int,input().split())) for i in range(N)]
C = sorted(C, key = lambda x : x[1],reverse =False)
#print(C)

A =[1001]
for i in C:
    if i[1] <= T:
        A.append(i[0])

print(min(A) if min(A) != 1001 else "TLE")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#2019/09/30
std_input = open(0).readlines()
N, T = map(int, std_input[0].split())
s_t = [list(map(int, i.rstrip("\n").split())) for i in std_input[1:1+N]]

cnt = 0
s_t_T = []
for i in s_t:
    if i[1] > T:
        cnt += 1
    else:
        s_t_T.append(i[0])

if cnt == N:
    print("TLE")
else:
    print(min(s_t_T))

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


def main():
    n, t = map(int, input().split())
    routes = list(
        filter(lambda x: x[1] <= t, [list(map(int, input().split())) for _ in range(n)])
    )
    if routes:
        print(min(routes)[0])
    else:
        print("TLE")


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def slove():
    import sys
    input = sys.stdin.readline
    n, t = list(map(int, input().rstrip('\n').split()))
    mt = 10 ** 9
    for i in range(n):
        c1, c2 = list(map(int, input().rstrip('\n').split()))
        if c2 <=t:
            mt = min(mt, c1)
    if mt == 10 ** 9:
        print("TLE")
    else:
        print(mt)


if __name__ == '__main__':
    slove()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,t = list(map(int, input().split()))
a = [list(map(int, input().split())) for _ in range(n)]
a.sort()
ans = "TLE"
for b,c in a:
    if c <= t:
        ans  = b
        break
print(ans)

Submission status: Accepted

Solution code:
MAX_INT = 10000000
N, T = map(int, input().split())
cl, tl = [], []

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

c_min = MAX_INT
for i in range(N):
    if tl[i] <= T:
        c_min = min(c_min, cl[i])

if c_min < MAX_INT:
    print(c_min)
else:
    print('TLE')

Submission status: Accepted

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

Submission status: Accepted

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

n, t = map(int, raw_input().split())

minCos = 1000
bestRoot = -1
for i in range(n):
    inpt = map(int, raw_input().split())
    if inpt[1] > t:
        continue

    if inpt[0] <= minCos:
        minCos = inpt[0]
        bestRoot = i + 1

if bestRoot == -1:
    print "TLE"
else:
    print minCos

Submission status: Accepted

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

Submission status: Accepted

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

n, T = map(int, input().split())
c = ["" for _ in range(n)]
t = ["" for _ in range(n)]

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

#print(c)
#print(t)

INF = 10**4
dp = INF
for i in range(n):
    if T >= t[i]:
        dp = min(dp, c[i])

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

Submission status: Accepted

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

# input
N, T = map(int, input().split())
c = [0] * N
t = [0] * N
for i in range(N):
    _c, _t = map(int, input().split())
    c[i] = _c
    t[i] = _t

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

# output
print(ans if ans != 1001 else 'TLE')

Submission status: Accepted

Solution code:
a,b = [int(i) for i in input().split()]

l =sorted([[int(i) for i in input().split()] for _ in range(a)],key = lambda x : x[0])

flg = True
for i in l:
    if i[1] <= b:
        print(i[0])
        flg = False
        break
    else:
        pass
    
if flg == True:
    print('TLE')

Submission status: Accepted

Solution code:
n,t = map(int, input().split())
ct = [list(map(int, input().split())) for _ in range(n)]
ct.sort()
#print(ct)
ck =0
for i in range(n):
    if ct[i][1]<=t:
        ck =1
        break
if ck ==1:
    print(ct[i][0])
    exit()
print('TLE')

Submission status: Accepted

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

Submission status: Accepted

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

fil_tr = list(filter(lambda x: x[1] <= t, tr))
if not fil_tr:
    print("TLE")
    exit()

sorted_tr = min(fil_tr, key=lambda x: x[0])
print(sorted_tr[0])

Submission status: Accepted

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

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

Submission status: Accepted

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

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

if min_cost < 10000:
    print(min_cost)
else:
    print('TLE')

Submission status: Accepted

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

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

path_before_t = list(filter(lambda x: x[1] <= t, path))
if len(path_before_t) == 0:
    print('TLE')
else:
    print(min(path_before_t)[0])

Submission status: Accepted

Solution code:
import numpy as np
N, T=map(int, input().split())
temp=np.array([list(map(int, input().split())) for i in range(N)])
temp=temp[temp[:, 1]<=T]
if temp.shape[0]==0:
  print('TLE')
else:
  print(np.min(temp[:, 0]))

Submission status: Accepted

Solution code:
n,t= map(int,input().split())
ct = sorted([list(map(int, input().split())) for _ in range(n)])
m=1001
for i in range(n):
    if(ct[i][1]<=t):
        m=min(m,ct[i][0])
if(m==1001):
    print("TLE")
else:
    print(m)

Submission status: Accepted

Solution code:
n, time = [int(_) for _ in input().split()]
tmp = 1001
output = 0

for i in range(n):
    c, t = [int(_) for _ in input().split()]
    if c < tmp and t <= time:
        tmp = c
        output = c

if output == 0:
    print("TLE")

else:
    print(output)

Submission status: Accepted

Solution code:
N,T = map(int,input().split())
cmin = 10**4
for _ in range(N):
    c,t = map(int,input().split())
    if t<=T:
        cmin = min(cmin,c)
if cmin>10**3:
    print("TLE")
else:
    print(cmin)

Submission status: Accepted

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

Submission status: Accepted

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

min_c = 1001

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,t=map(int,input().split())
cost=[]
time=[]
for i in range(n):
    x,y=map(int,input().split())
    cost.append(x)
    time.append(y)
z=[]
for i in range(n):
    if time[i]<=t:
        z.append(cost[i])
if len(z)==0:
    print('TLE')
else:
    print(min(z))

Submission status: Accepted

Solution code:
n, t = map(int, input().split())
case = []
for i in range(n):
  c = list(map(int, input().split()))
  case.append(c)
mini = 1e9
for i in range(n):
  if(t>= case[i][1]):
    if(mini>case[i][0]):
      mini = case[i][0]
if(mini == 1e9):
  print("TLE")
else:
  print(mini)

Submission status: Accepted

Solution code:
n,t=map(int,input().split())
ans=1001
for i in range(n):
    a,b=map(int,input().split())
    if b<=t:
        ans=min(ans,a)
print(ans if ans!=1001 else "TLE")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys


N, T = map(int, input().split())
CT = [list(map(int, input().split())) for _ in range(N)]
target_list = [[c, t] for c, t in CT if t <= T]

if len(target_list) == 0:
    print('TLE')
else:
    target_list = sorted(target_list, key=lambda t: t[0])
    print(target_list[0][0])

Submission status: Accepted

Solution code:
N, T = map(int, input().split())
ct = list(filter(lambda x: x[1] <= T, [list(map(int, input().split())) for _ in range(N)]))
ct = sorted(ct, key=lambda x: x[0])
if not ct:
    print('TLE')
else:
    print(ct[0][0])

Submission status: Accepted

Solution code:
s=list(input().split())
n=int(s[0])
l=int(s[1])
cost=[]
time=[]

for i in range(n):
  li=list(input().split())
  if int(li[1])<=l:
    cost.append(int(li[0]))
    time.append(int(li[1]))
if len(cost)==0:
  print('TLE')
else:
  print(min(cost))

Submission status: Accepted

Solution code:
N, T = map(int, input().split())
mc = 1e4
for _ in range(N):
    c, t = map(int, input().split())
    if t <= T and c < mc:
        mc = c

print(mc if mc <= 1000 else "TLE")

Submission status: Accepted

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

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())
A=[]
for i in range(n):
  a=list(map(int, input().split()))
  if a[1] <= t:
    A.append(a[0])
if len(A)==0:
  print('TLE')
else:
  print(min(A))

Submission status: Accepted

Solution code:
# ABC112b
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

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

ans = 9999

for i in c:
    if (i[1] <= t):
        ans = min(ans, i[0])
print(ans if ans != 9999 else 'TLE')

Submission status: Accepted

Solution code:
import sys
n, t = map(int,input().split())
src = [list(map(int,input().split())) for _ in range(n)]
new = []
for s in src:
    if s[1] <= t:
        new.append(s[0])
if len(new) == 0:
    print('TLE')
    sys.exit()
print(min(new))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,t=map(int, input().split())
Routes=[list(map(int, input().split())) for _ in range(n)]
r=list(filter(lambda x:x[1] <= t, Routes))
if not r:
    ans="TLE"
else:
    ans=sorted(r)[0][0]

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,t1 = map(int,input().split())
ls = []
ans = 1001
for i in range(n):
    c,t2 = map(int,input().split())
    if t1 >= t2:
        ans = min(c,ans)
    
if ans != 1001:
    print(ans)
else:
    print("TLE")

Submission status: Accepted

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

best_c = 1001
best_t = t

for _ in range(n):
  c_i, t_i = map(int, input().split())
  if (t_i <= t) & (c_i < best_c):
    best_c = c_i
    
print(best_c if best_c != 1001 else 'TLE')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#ABC112B
n,T = list(map(int,input().split()))
c,t = [0]*n,[0]*n
for i in range(n):
    c[i],t[i] = list(map(int,input().split()))
    
a = []
for i in range(n):
    if t[i]<=T:
        a.append(c[i])
if a==[]:
    print('TLE')
else:
    print(min(a))

Submission status: Accepted

Solution code:
n, T = map(int, input().split())
cMin = 10000
for i in range(n):
    c, t = map(int, input().split())
    if cMin > c and T >= t:
        cMin = c
print(cMin if cMin != 10000 else "TLE")

Submission status: Accepted

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

Submission status: Accepted

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

ans=10100
flag=False
for d,e in zip(clist,tlist):
  if e<=T:
    ans=min(ans,d)
    flag=True
if flag == False:
  print("TLE")
else:
  print(ans)

Submission status: Accepted

Solution code:
[n,t]=list(map(int,input().split()))
ntlist=[list(map(int,input().split())) for _ in range(n)]
 
anslist=[nt[0] for nt in ntlist if nt[1]<=t]
if anslist==[]:
  print("TLE")
else:
  print(min(anslist))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC112B - Time Limit Exceeded
def main():
    N, T, *CT = map(int, open(0).read().split())
    cand = {c for c, t in zip(*[iter(CT)] * 2) if t <= T}
    flg = cand
    print(min(cand) if flg else "TLE")


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N, T = map(int, input().split())
root = []
for i in range(N):
    cost, time = map(int, input().split())
    if time <= T:
        root.append(cost)
if len(root) != 0:
    root.sort()
    print(root[0])
else:
    print('TLE')

Submission status: Accepted

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

Submission status: Accepted

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

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

    if t <= T:
        if ans > c:
            ans = c

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N,T = list(map(int,input().split()))
c0 = 1000
count = 0
for i in range(N):
  c,t = list(map(int,input().split()))
  if t <= T:
    if c < c0:
      c0 = c
    else:
      continue
  else:
    count += 1
    continue

if count == N:
  print("TLE")
else:
  print(c0)

Submission status: Accepted

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

ans = 10000
for _ in range(n):
    cost, time = map(int, input().split())
    if time <= t:
        ans = min(cost, ans)

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

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

Submission status: Accepted

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

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

if ans == 1001:
    ans = "TLE"

print(ans)

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:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
N,T= map(int,input().split())

c=[]
t=[]
m=10000
cnt=0
C=[list(map(int,input().split())) for _ in range(N)]

for j in range(N):
	if C[j][1]>T:
		cnt+=1
	else:
		m=min(C[j][0],m)
		

	

if cnt==N:
	print("TLE")
else:
	print(m)

Submission status: Accepted

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

if len(cand) > 0:
    cand.sort()
    print(cand[0])
else:
    print('TLE')

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(1000000000)
ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())

def main():
    N, T = mis()
    lis = []
    for _ in range(N):
        c,t = mis()
        if t<=T:
            lis.append(c)
    if lis:
        print(min(lis))
    else:
        print('TLE')

main()

Submission status: Accepted

Solution code:
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(ans if ans != 10000 else "TLE")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,t=map(int,input().split())
ans=10000
for i in range(n):
  x,y=map(int,input().split())
  if y<=t:
    ans=min(ans,x)
if ans!=10000:
  print(ans)
else:
  print("TLE")

Submission status: Accepted

Solution code:
N,T=map(int,input().split())
C=[list(map(int, input().split())) for _ in range(N)]
e=10000
for i in C:
  if T>=i[1] and e>i[0]:
    e=i[0]
print('TLE' if e==10000 else e)

Submission status: Accepted

Solution code:
N,T=map(int,input().split())
C=[list(map(int, input().split())) for _ in range(N)]
e=[]
for i in C:
  if T>=i[1]:
    e.extend([i[0]])
print('TLE' if len(e)==0 else min(e))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

N, T = map(int,input().split())
ct=[list(map(int, input().split())) for _ in range(N)]
INF = 100000
ans = INF
for i in range(N):
    if ct[i][1] > T: continue
    ans = min(ans,ct[i][0])
if ans == INF:
    ans="TLE"
print(ans)

Submission status: Accepted

Solution code:
import sys
N, T = map(int, sys.stdin.readline().strip().split())  # N個の帰宅経路, T時間以内に

cost = 1001
for line in sys.stdin.readlines():
    c, t = map(int, line.strip().split())
    if T >= t:
        cost = min(cost, c)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, T = map(int, input().split())
C = 1000
flag = 0
for i in range(N):
    c, t = map(int, input().split())
    if t <= T and c <= C:
        C = c
        flag = 1

if flag == 1:
    print(C)
else:
    print('TLE')

Submission status: Accepted

Solution code:
N, T = map(int, input().split())
cts = []
for i in range(N):
  c, t = map(int, input().split())
  cts.append((c, t))
cts2 = list(filter(lambda ct: ct[1] <= T, cts))
if len(cts2) == 0:
  print("TLE")
  exit()
r = min(map(lambda ct: ct[0], cts2))
print(r)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(N):
	ok.append([int(i) for i in input().split()])
		
ok.sort(key=lambda x: x[0])

ans = 1200

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

Submission status: Accepted

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

Submission status: Accepted

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

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("TLE" if cost == 1001 else cost)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*-coding: utf-8 -*-
N, T = map(int, input().split())
ct = []
for i in range(N):
    ct.append(list(map(int, input().split())))
ans_list = []
for i in range(N):
    if ct[i][1] <= T:
        ans_list.append(ct[i][0])

if len(ans_list) == 0:
    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 i in range(N)]

ans = float("inf")

for i in range(N):
    c,t = CT[i]
    if t <= T:
        if ans > c:
            ans = c
            
if ans == float("inf"):
    print("TLE")
else:
    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())
  if(t<=T):
    a.append(c)
if(len(a)==0):
  print("TLE")
else:
  a.sort()
  print(a[0])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,T = map(int,input().split())
ans = 10000
for _ in range(N):
    c,t = map(int,input().split())
    if t <= T:
        if ans > c:
            ans = c
if ans == 10000:
    print('TLE')
else:
    print(ans)

Submission status: Accepted

Solution code:
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)
if ans == 10000:
    print("TLE")
else:
    print(ans)

Submission status: Accepted

Solution code:
"""#################################################################
【ABC112】
B_Time_Limit_Exceeded
#################################################################"""

#インポート
import sys

#入力用
def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())
def II(): return int(sys.stdin.readline().rstrip())
def ISS(): return sys.stdin.readline().rstrip().split()
def IS(): return sys.stdin.readline().rstrip()

N, T = ISI()
min = 999999
for i in range(N):
    c, t = ISI()
    if t <= T:
        if min > c:
            min = c
if min == 999999:
    print("TLE")
else:
    print(min)

Submission status: Accepted

Solution code:
N,T=map(int,input().split())
ct = [[0,0] for i in range(N)]
for i in range(N):
  ct[i]=list(map(int,input().split()))
ct.append([-1,T])
ct.sort(key=lambda x:x[1])
index = ct.index([-1,T])
if index==0:
  print("TLE")
else:
  ans = sorted(ct[:index],key=lambda x:x[0])
  print(ans[0][0])

Submission status: Accepted

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

r=2000+t

for _ in range(n):
  a,b=map(int,input().split())
  if b<=t and a<r:
    r=a
if r==2000+t:
  print("TLE")
else:
  print(r)

Submission status: Accepted

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

r=2000

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

Submission status: Accepted

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

c = 2000
for i in list:
    if i[1] <= t and c > i[0]:
        c = i[0]
if c != 2000:
    print(c)
else:
    print("TLE")

Submission status: Accepted

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