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 _ in range(N)]
res = 1001
for c, t in CT:
    if t <= T:
        res = min(res, c)
print(res if res <= 1000 else 'TLE')

Submission status: Accepted

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

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

cost = 10000

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

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

Submission status: Accepted

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

if not c:
  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:
import operator

N, T = [int(i) for i in input().split()]
ct_list = [ [int(i) for i in input().split()] for j in range(N)]

tmp = list(filter(lambda x: operator.ge(T,x[1]), ct_list))

ans = min(tmp, key=lambda x: x[0])[0] if len(tmp) != 0 else "TLE"
print(ans)

Submission status: Accepted

Solution code:
#a=int(input())
#b,c=int(input()),int(input())
# c=[]
#  for i in b:
#     c.append(i)
N,T = map(int,input().split())
# f = list(map(int,input().split()))
#j = [input() for _ in range(a)]
# h = []
# for i in range(e1):
#     h.append(list(map(int,input().split())))
a=[]
for i in range(N):
    c,d = map(int,input().split())
    if T>=d:
        a.append(c)
if len(a)==0:
    print("TLE")
else:print(min(a))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,T=map(int,input().split())
k=1000
l=1
for i in range(N):
    c,t=map(int,input().split())
    if t <= T:
        l=0
        if c < k:
            k = c
if l==1:
    print('TLE')
else:
    print(k)

Submission status: Accepted

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

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

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)
if len(ans) == 0:
    print("TLE")
else:
    print(min(ans))

Submission status: Accepted

Solution code:
import math
from statistics import mean
# a=int(input())
#b=int(input())
# c=[]
# for i in b:
#     c.append(i)
e1,e2 = map(int,input().split())
#f = list(map(int,input().split()))
#j = [input() for _ in range(3)]
h = []
for i in range(e1):
    h.append(list(map(int,input().split())))
r=[]
count=0
for i in range(e1):
    if h[i][1]<=e2:
         r.append(h[i][0])

if len(r)>0:
    print(min(r))
else:
    print("TLE")

Submission status: Accepted

Solution code:
N, T = map(int, input().split())
INF = 10**9
res = INF
for _ in range(N):
    c, t = map(int, input().split())
    if t <= T and c < res:
        res = c
print(res if res != INF else 'TLE')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, T = map(int, input().split())
c = [0 for _ in range(n)]
t = [0 for _ in range(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:
        ans = min(ans, c[i])
print(ans if ans != 1001 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 = list(sorted(l,key=lambda x:x[1]))
c,m = [list(i) for i in zip(*l)]
ans = 9999
for i in range(n):
    if m[i] > t:
        break
    else:
        ans = min(ans,c[i])
if ans == 9999:
    print('TLE')
else:
    print(ans)

Submission status: Accepted

Solution code:
N,T=list(map(int,input().split()))
ans=float("inf")
for i in range(N):
   a,b=map(int,input().split())
   if T>=b:
      ans=min(ans,a)
print("TLE" if ans==float("inf") else ans)

Submission status: Accepted

Solution code:
n, t = map(int, input().split())
c = 10000
for i in range(n):
    tmp = input().split()
    if t >= int(tmp[1]):
        if int(tmp[0]) < c:
            c = int(tmp[0])
if c == 10000:
    print('TLE')
    exit()
else:
    print(c)

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 and c < C:
    C = c
if C == 1001:
  print ('TLE')
else:
  print (C)

Submission status: Accepted

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

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

DR = [1, -1, 0, 0]
DC = [0, 0, 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 main():
    N, T = LI()
    ans = inf
    for i in range(N):
        c, t = LI()
        if t <= T:
            ans = min(ans, c)
    if ans == inf:
        print("TLE")
        return
    print(ans)

main()

Submission status: Accepted

Solution code:
# ABC112

N, T = map(int, input().split())
C_T = [map(int, input().split()) for _ in range(N)]
temp_c = 10**10
for c, t in C_T:
    if t <= T and c <= temp_c:
        temp_c = c


if temp_c == 10**10:
    ans = "TLE"
else:
    ans = temp_c
print(ans)

Submission status: Accepted

Solution code:
a,b=input().split()
a=int(a)
b=int(b)
c=[input().split() for i in range(a)]
d=1001
for i in range(a):
  if int(c[i][1])<=b:
    if d>int(c[i][0]):
      d=int(c[i][0])
if d==1001:
  print("TLE")
else:
  print(d)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


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

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main():
    n, T = map(int, input().split())
    c_list = []

    for _ in range(n):
        c, t = map(int, input().split())
        if t <= T:
            c_list.append(c)

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def main():
    n, T = map(int, input().split())
    min_c = 1000
    is_able = False

    for _ in range(n):
        c, t = map(int, input().split())
        if t <= T:
            is_able = True
            if c < min_c:
                min_c = c

    if is_able:
        print(min_c)
    else:
        print("TLE")


if __name__ == "__main__":
    main()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, T = map(int, input().split())
min_cost = 10**9
for i in range(N):
    c, t = map(int, input().split())
    if t > T:
        continue
    else:
        min_cost = min(min_cost, c)
if min_cost != 10**9:
    print(min_cost)
else:
    print("TLE")

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:
n, t = map(int, input().split())

c = []

for i in range(0,n):
    c_i, t_i = map(int, input().split())

    if t_i <= t:
        c.append(c_i)

if len(c) > 0:
    print(min(c))
else:
    print("TLE")

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

res = 10000

for i in range(n):
    a,b = map(int, input().split())
    if b <= t:
        res = min(res,a)

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

Submission status: Accepted

Solution code:
import math
N,T=map(int, input().split())
ans = math.inf
for i in range(N):
    c,t=map(int,input().split())
    if t <= T:
        ans = min(ans, c)
print(ans if ans != math.inf else "TLE")

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:
n, T = map(int, input().split())
x = list()
cnt = 0
for i in range(n):
    c, t = map(int, input().split())
    if t <= T:
        x.append(c)
        cnt = 1
if cnt == 0:
    print("TLE")
else:
    print(min(x))

Submission status: Accepted

Solution code:
N,T=map(int,input().split())
li=[list(map(int,input().split())) for i in range(N)]
li2=[]
for i in range(N):
  if li[i][1]<=T:
    li2.append(li[i])
li2.sort()
if len(li2)==0:
  print('TLE')
  exit()
print(li2[0][0])

Submission status: Accepted

Solution code:
n,k=map(int,input().split())
c=1000000
for i in range(n):
    x,y=map(int,input().split())
    if(y<=k):
        c=min(c,x)
if(c==1000000):
    print("TLE")
else:
    print(c)

Submission status: Accepted

Solution code:
# coding: utf-8

num, time = map(int, input().split())
count = 0
ans = 10000
for i in range(num):
    cost, tm = map(int, input().split())
    if tm <= time:
        if cost < ans:
            ans = cost
            max = ans
            count = 1
if count == 0:
    print("TLE")
else:
    print(ans)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

import numpy as np

c = np.zeros(N)
t = np.zeros(N)

for i in range(N):
  c[i], t[i] = input().split()
  c[i] = int(c[i])
  t[i] = int(t[i])
  if t[i] > T :
    c[i] = 1001

if min(c) == 1001:
  print('TLE')
  
else:
  print(int(min(c)))

Submission status: Accepted

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

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

if res < 10 ** 9:
    print(res)
else:
    print("TLE")

Submission status: Accepted

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

Submission status: Accepted

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

ans = 1001
for ct in CT:
    if ct[1] <= T:
        ans = min(ans, ct[0])

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

cost = []

for c, t in ct:
    if t <= T:
        cost.append(c)

if len(cost) == 0:
    print("TLE")
else:
    print(min(cost))

Submission status: Accepted

Solution code:


def main():
    N, T = map(int, input().split())
    l = []
    for _ in range(N):
        c, t = map(int, input().split())
        l.append((c, t))
    l.sort()
    for e in l:
        if e[1] <= T:
            print(e[0])
            return
    print("TLE")
        

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n, t = map(int, input().split())
c_lists = []
t_lists = []
for i in range(n):
  c_i, t_i = map(int, input().split())
  c_lists.append(c_i)
  t_lists.append(t_i)

costs = []
for j in range(n):
    if t_lists[j] <= t:
        costs.append(c_lists[j])
if not costs:
    ans = 'TLE'
else:
    costs.sort()
    ans = costs[0]
print(ans)

Submission status: Accepted

Solution code:
N,T = map(int,input().split())
ct=[9999]
for _ in range(N):
    ctt= list(map(int,input().split()))
    if ctt[1]<=T:
        ct.append(ctt[0])
if ct==[9999]:
    print("TLE")
    exit()
print(min(ct))

Submission status: Accepted

Solution code:
import sys
import math

#https://atcoder.jp/contests/agc008/submissions/15248942
sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))

N,T = inm()
min_cost = 2000

for i in range(N):
    c,t = inm()
    if t <= T:
        min_cost = min(min_cost,c)

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

Submission status: Accepted

Solution code:
import sys
def MI(): return map(int,sys.stdin.readline().rstrip().split())

N,T = MI()

ans = 10000
for i in range(N):
    c,t = MI()
    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())

cost = []

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

if len(cost) > 0:
    print(min(cost))
else:
    print("TLE")

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

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


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

    ans = INF
    for _ in range(N):
        c, t = map(int, readline().split())
        if t <= T and ans > c:
            ans = c
    
    if ans < INF:
        print(ans)
    else:
        print('TLE')
    return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n,t=map(int,input().split())
ct=[list(map(int,input().split())) for i in range(n)]
flag=0
ans=ct[0][0]
for i in range(n):
    if ct[i][1]<=t:
        flag=1
        ans=min(ans,ct[i][0])
    else:
        pass
if flag==0:
    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)
    else:
        l.append(1001)

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

Submission status: Accepted

Solution code:
n,T = map(int,input().split())
ct = [list(map(int,input().split())) for _ in range(n)]
li = []
for k in ct:
    if k[1]<=T:
        li += [k[0]]
if li ==[]:
    print("TLE")
else:
    print(min(li))

Submission status: Accepted

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

ans = "TLE"
for i in range(N):
    c, t = map(int,input().split())
    if t <= T:
        if ans == "TLE" or ans > c:
            ans = c

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [list(input()) for _ in range(n)]
#a = [input() for _ in range(n)]

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

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

if len(costs) == 0:
    print("TLE")
else:
    print(min(costs))

Submission status: Accepted

Solution code:
N,T=map(int,input().split())
cost=1000000
num=-1
for i in range(N):
  c,t=map(int,input().split())
  if t<=T and cost > c:
    cost = c
    num = i+1
print(cost if num > 0 else 'TLE')

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

z = zip(c, t)
z = sorted(z)
c, t = zip(*z)

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

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

Submission status: Accepted

Solution code:
import sys


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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.insert(i,c1)
if len(c) == 0:
    print("TLE")
else:
    c.sort(key=int)
    print(c[0])

Submission status: Accepted

Solution code:
n, timelimit = map(int, input().split() )
ans = 1001
for i in range (n):
  cost, time = map(int, input().split() )
  if time <= timelimit:
    ans = min(ans, cost)
print (ans if ans <= 1000 else "TLE")

Submission status: Accepted

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

ans = float('inf')

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

print(ans if ans < float('inf') else 'TLE')

Submission status: Accepted

Solution code:
n, t = map(int, input().split())
res = 1000 + 1
for i in range(n):
    ci, ti = map(int, input().split())
    if ti <= t:
        res = min(res, ci)

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

Submission status: Accepted

Solution code:
n, t = map(int, input().split())
# 経路の最小コスト
a = 10**19
for _ in range(n):
    c, tt = map(int, input().split())
    if t >= tt:
        a = min(c, a)
# 対象経路がない
if a == 10**19:
    print('TLE')
else:
    print(a)

Submission status: Accepted

Solution code:
n, t = map(int, input().split())
a = 10**19
for _ in range(n):
    c, tt = map(int, input().split())
    if t >= tt:
        a = min(c, a)
if a == 10**19:
    print('TLE')
else:
    print(a)

Submission status: Accepted

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

dic = {}
for i in range(n):
    a,b = map(int, input().split())
    dic[a] = b

dic = sorted(dic.items(), key = lambda x : x[0])

for i,j in dic:
    if j <= t:
        print(i)
        exit()
print('TLE')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, T = map(int, input().split())
min_cost = int(1e9)+11
flg = False
for i in range(N):
    c, t = map(int, input().split())
    if t <= T:
        flg = True
        min_cost = min(min_cost, c)
if flg:
    print(min_cost)
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)
if ans<1001:
    print(ans)
else:
    print('TLE')

Submission status: Accepted

Solution code:
N, T = list(map(lambda x : int(x), input().split(" ")))
cand = []
for i in range(N):
  c, t = list(map(lambda y : int(y), input().split(" ")))
  if t <= T:
    cand.append(c)

if len(cand) > 0:
  print(min(cand))
else:
  print("TLE")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
if __name__ == '__main__':

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

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

Submission status: Accepted

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

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

for j in range(len(l_c)):
    if l_c[j] == min(l_c):
        print(l_c[j])
        exit()

print('TLE')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

arrays = []

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

ans = 10**9

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n, l = map(int, input().split())
ans = 10**9
for i in range(n):
    c, t = map(int, input().split())
    if t <= l:
        ans = min(ans, c)
if ans == 10**9:
    print('TLE')
else:
    print(ans)

Submission status: Accepted

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

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

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

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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