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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#
# Written by NoKnowledgeGG @YlePhan
# ('ω')
#
#import math
#mod = 10**9+7
#import itertools
#import fractions
#import numpy as np
#mod = 10**4 + 7
"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""
 
def main():
  n,t = map(int,input().split())
  mi_ = float("inf")
  change = False
  for _ in range(n):
    c,t_ = map(int,input().split())
    if t_ <= t:
      mi_ = min(mi_,c)
      change = True
  if change:
    print(mi_)
  else:
    print('TLE')
  
if __name__ == '__main__':
  main()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 10000

for i in range(n):
    if T[i][1] > t:
        continue
    else:
        ans = min(ans, T[i][0])

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

Submission status: Accepted

Solution code:
N, T = map(int, input().split())
m = 1001
for _ 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(" "))
C = 10**9
for i in range(N):
  c,t = map(int,input().split(" "))
  if t>T:
    continue
  else:
    if c<C:
      C=c
if C==10**9:
  print("TLE")
else:
  print(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)
if len(C)>0:
    print(min(C))
else:
    print("TLE")

Submission status: Accepted

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

resolve()

Submission status: Accepted

Solution code:
N, T = map(int, input().split())
ct=[]
for _ in range(N):
    ct.append(tuple(map(int, input().split())))
OK=[tpl for tpl in ct if tpl[1]<=T]
if OK:
    good=min(OK, key=lambda x:x[0])
    print(good[0])
else:
    print('TLE')

Submission status: Accepted

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

res = 1001
for c, t in ct:
    if t <= T:
        res = min(res, c)
if res != 1001:
    print(res)
else:
    print("TLE")

Submission status: Accepted

Solution code:
a=list(map(int,input().split()))
b=[]
c=10000
for i in range(a[0]):
    b.append(list(map(int,input().split())))
for j in range(a[0]):
    if b[j][1]<=a[1] and c>b[j][0]:
        c=b[j][0]
if c!=10000:
    print(c)
else:
    print("TLE")

Submission status: Accepted

Solution code:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n,T = iim()
cost = 1001
for i in range(n):
    c,t = iim()
    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())
l=[]
for i in range(n):
  ci,ti=map(int,input().split())
  if ti<=t:
    l.append(ci)
print(min(l) if len(l)>0 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('TLE')
else:
    print(min(cost))

Submission status: Accepted

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

res = 1001
for c, t in ct:
    if t <= T:
        res = min(res, c)
if res != 1001:
    print(res)
else:
    print("TLE")

Submission status: Accepted

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

Submission status: Accepted

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

cost = 1001
count = 0
for i in range(N):
    if lists[i][1] <= T:
        count += 1
        if i == 0:
            cost = lists[i][0]
        elif cost >= lists[i][0]:
            cost = lists[i][0]
        else:
            continue
    else:
        continue
if count == 0:
    print("TLE")
else:
    print(cost)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, T = map(int,input().split())
cntn = [list(map(int,input().split())) for _ in range(N)]
cost = pow(10,10)
for n in range(N):
  if cntn[n][1] <= T: cost = min(cost,cntn[n][0])
print("TLE" if cost == pow(10,10) else cost)

Submission status: Accepted

Solution code:
N, T = map(int, input().split())
ans = 1e9
for n 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:
import sys

n,t=map(int,input().split())
be=1001
count=0
for _ in range(n):
  c,time=map(int,input().split())
  if time<=t and c<=be:
    count+=1
    be=c
  if _==n-1 and count==0:
    print("TLE")
    sys.exit()
    
print(be)

Submission status: Accepted

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

cost = 1001
count = 0
for i in range(N):
    if lists[i][1] <= T:
        count += 1
        if i == 0:
            cost = lists[i][0]
        elif cost >= lists[i][0]:
            cost = lists[i][0]
        else:
            continue
    else:
        continue
if count == 0:
    print("TLE")
else:
    print(cost)

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:
#template
def inputlist(): return [int(j) for j in input().split()]
#template
#issueから始める
N,T = inputlist()
ans = 10**9
for i in range(N):
    c,t = inputlist()
    if t <= T:
        ans = min(ans,c)
if ans == 10**9:
    ans = 'TLE'
print(ans)

Submission status: Accepted

Solution code:
import sys
from bisect import *
from heapq import *
from collections import *
from itertools import *
from functools import *
from math import *
from fractions import *

sys.setrecursionlimit(100000000)
input = lambda: sys.stdin.readline().rstrip()


def main():
    N, T = map(int, input().split())
    roads = [tuple(map(int, input().split())) for _ in range(N)]
    roads = [(c, t) for c, t in roads if t <= T]
    print('TLE' if len(roads) == 0 else min(c for c, _ in roads))

main()

Submission status: Accepted

Solution code:
N,T = map(int,(input().split()))
c = [[0]*2 for _ in range(N)]
ans = []
for i in range(N):
    c[i][0],c[i][1] = map(int,(input().split()))
    if c[i][1] <= T:
        ans.append(c[i][0])
if ans:
    ans.sort()
    print(ans[0])
else:
    print("TLE")

Submission status: Accepted

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

Submission status: Accepted

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

ct = sorted(ct)
for c, t in ct:
    if t<=T:
        print(c)
        exit()

print('TLE')

Submission status: Accepted

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

ans = []

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

Submission status: Accepted

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

result = 1001
for i in range(n):
    c,t = list(map(int,input().split()))
    if t <= limit and c < result:
        result = c

print(result if result < 1001 else 'TLE')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
N, T = [int(str) for str in input().strip().split()]
ct = [[int(str) for str in input().strip().split()] for _ in range(N)]

costs = [c for c, t in ct if t <= T]

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

Submission status: Accepted

Solution code:
n, T = map(int, input().split())
keiro = []
for _ in range(n):
    c, t = map(int, input().split())
    if t <= T:
        keiro.append((c,t))
if len(keiro) == 0:
  print('TLE')
else:
  sortedkeiro = sorted(keiro, key= lambda x: x[0])
  print(sortedkeiro[0][0])

Submission status: Accepted

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

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

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:
        if c<ans:
            ans=c
if ans==100000:
    ans="TLE"
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#import sys
#import math
#import numpy as np

'''a,b= map(int,input().split())'''
#a, b, c = [list(map(int, input().split())) for _ in range(3)]
#li0= [int(x) for x in input().split()]
#n,l= map(int, input().split())
#x = [list(map(int, input().split())) for _ in range(n)] 
n,b=map(int,input().split())
ans=100**4
x=[list(map(int,input().split())) for _ in range(n)]
for i in range(n):
  if x[i][1]<=b:
    ans=min(ans,x[i][0])
if ans==100**4:
  print('TLE')
else:
  print(ans)

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

if(min(t) > T):
    print("TLE")
    exit()
else:
    ans = 1000
    for i in range(N):
        if t[i] <= T:
            ans = min(ans, c[i])

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

Submission status: Accepted

Solution code:
#n 経路の数
#t 時間
# cost 時間
n,t = map(int,input().split())
#cost_time = [input().split() for i in range(n)]
cost_time = [list(map(int,input().split())) for i in range(n)]
result =float('inf')
inf =  float("inf")
for i in range(n):
    time = cost_time[i][1]
    if t >= time and result >= cost_time[i][0]:
       result = cost_time[i][0]
if result == inf:
    print("TLE")
else:
    print(result)

Submission status: Accepted

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

ct=sorted(ct)
answer="TLE"

for i in range(N):
    if ct[i][1]<=T:
        answer=ct[i][0]
        break
print(answer)

Submission status: Accepted

Solution code:
N, T = map(int, input().split())
ans = 10 ** 4
root = [list(map(int, input().split())) for _ in range(N)]

for i in range(N):
    if root[i][1] > T:
        continue
    else:
        ans = min(ans, root[i][0])

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

Submission status: Accepted

Solution code:
N,T = map(int,input().split())
root = []
ans = 10**4
for i in range(N):
    c,t = map(int,input().split())
    root.append([c,t])
for i in range(N):
    if root[i][1] > T:
        continue
    else:
        ans = min(ans,root[i][0])
if ans == 10**4:
    print("TLE")
else:
    print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N, T = map(int, input().split())
i = 0
ans = 1001
for i in range(N):
    c, t = map(int, input().split())
    if T >= t and c < ans:
        ans = c

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

Submission status: Accepted

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

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n, t = map(int, input().split())
l = [list(map(int, input().split())) for i in range(n)]
m = []
for j in range(n):
    if l[j][1] <= t:
        m.append(l[j][0])
if len(m) == 0:
    print("TLE")

else:
    print(min(m))

Submission status: Accepted

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

ans = 1001
for c, t in CT:
    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())

min_cost = float('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 == float('inf'):
    print('TLE')
else:
    print(min_cost)

Submission status: Accepted

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

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

if len(clist)== 0:
  print('TLE')
  exit()

print(min(clist))

Submission status: Accepted

Solution code:
N, T = map(int, input().split())
ans = float('inf')
for _ in range(N):
  a, b = map(int, input().split())
  if b <= T:
    ans = min(a, ans)
if ans == float('inf'):
  ans = 'TLE'
print(ans)

Submission status: Accepted

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

ans = 1001
for c,t in ct:
    if t > T:
        continue
    if ans > c:
        ans = c

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

Submission status: Accepted

Solution code:
n, t = map(int, input().split())
m = 114514
for _ in range(n):
    c, s = map(int, input().split())
    if s <= t and c < m:
        m = c
if m == 114514:
    print("TLE")
else:
    print(m)

Submission status: Accepted

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

Submission status: Accepted

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

INF = 1000000007
ans = INF
for r in root:
  if r[1] > t:
    continue
  ans = min(ans, r[0])

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

Submission status: Accepted

Solution code:
def main():
    n, T = map(int, input().split())
    cts = [list(map(int, input().split())) for _ in range(n)]
    ans = float("inf")
    for ct in cts:
        c, t = ct
        if t <= T:
            ans = min(ans, c)

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

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n,t = map(int,input().split())
ans = 1001
for _ in range(n):
    c,tp = map(int,input().split())
    if tp > t: continue
    ans = min(ans, c)
print(ans if ans != 1001 else 'TLE')

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("TLE" if ans == 2000 else ans)

Submission status: Accepted

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

m=99999
for i in range(n):
    if l[i][1]<=t:
        m=min(l[i][0],m)

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

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)

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

Submission status: Accepted

Solution code:
N, T = map(int, input().split())
C = [0]*N
for i in range(N):
  C[i] = list(map(int, input().split()))

C.sort()
for c,t in C:
  if t<=T:
    print(c)
    exit()
print('TLE')

Submission status: Accepted

Solution code:
#abc112 b
n,T=map(int,input().split())
c=[]
t=[]
ans=10001
for i in range(n):
    a,b=map(int,input().split())
    c.append(a)
    t.append(b)
for i in range(n):
    if t[i]>T:
        continue
    ans=min(ans,c[i])
if ans==10001:
    print("TLE")
else:
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, T = map(int, input().split())
ans = float('inf')
cost = float('inf')

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n,t= map(int, input().split())
l=[]
for i in range(n):
        l.append(list(map(int, input().split())))
ans = 10**9
for i in range(n):
        cost = l[i][0]
        time = l[i][1]
        if time <= t and cost < ans:
                ans=cost
if ans == 10**9:
        print("TLE")
else:
        print(ans)

Submission status: Accepted

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

ct = []

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

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

ans = 1001

for i in range(N):
    if ct[i][1] <= T:
        ans = ct[i][0]
        break

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import os


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N, T = list(map(int, sys.stdin.readline().split()))

    ret = 1001
    for n in range(N):
        c, t = list(map(int, sys.stdin.readline().split()))
        if T >= t: ret = min(c, ret)

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
import os


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N, T = list(map(int, sys.stdin.readline().split()))
    ct = [list(map(int, sys.stdin.readline().split()))for i in range(N)]

    ret = 1001
    for n in range(N):
        if T >= ct[n][1] and ret > ct[n][0]:
            ret = ct[n][0]

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

if res == 10 ** 100:
    print('TLE')
else:
    print(res)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

ans = 10 ** 10
for i in range(n):
    cost = ct[i][0]
    time = ct[i][1]
    if time <= t:
        ans = min(ans, cost)

if ans == 10 ** 10:
    ans = 'TLE'

print(ans)

Submission status: Accepted

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

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

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

arr = []
for i in range(n):
    if t[i] <= T:
        arr.append(c[i])

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#ABC112
    
n,t = list(map(int,input().split()))
c = [list(map(int,input().split())) for _ in range(n)]
m = 1001
for i in range(n):
    if c[i][1] <= t and m > c[i][0]:
        m = c[i][0]
        
print(m) if m != 1001 else print("TLE")

Submission status: Accepted

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

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())
cnt = 1000
jdg = False
for _ in range(N):
    c, t = map(int,input().split())
    if t <= T: 
        cnt = min(cnt,c)
        jdg = True
        
if jdg:
    print(cnt)
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)]
ans, sav = 1001, 0
for i in A:
    if i[1] <= T:
        sav = i[0]
        if ans > sav:
            ans = sav
if ans > 1000:
    ans = "TLE"
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('TLE')
else:
    print(min(l))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,T = map(int,input().split())
min_c = 10**4
for i in range(n):
    c,t = map(int,input().split())
    if t<=T and min_c>c:
        min_c = c
print('TLE' if min_c==10**4 else min_c)

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())
c_min = max(c)
if min(t) > T:
  print("TLE")
  quit()
  
for i in range(N):
  if t[i] <= T:
    if c[i] < c_min:
      c_min = c[i]
print(c_min)

Submission status: Accepted

Solution code:
n,T = map(int,input().split())
ans = 10**4
for i in range(n):
  c,t = map(int,input().split())
  if t <= T:
    ans = min(ans,c)
if ans == 10**4:
  ans = "TLE"
print(ans)

Submission status: Accepted

Solution code:
import math
import itertools
import statistics
#n = int(input())
n, T = list(map(int, input().split()))
c = []
t = []
for i in range(n):
    x,y = [int(j) for j in input().split()]
    c.append(x)
    t.append(y)

m = 10000
for i in range(n):
    if t[i] <= T:
        if c[i] < m:
            m = c[i]

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

Submission status: Accepted

Solution code:
N,T=map(int,input().split())
c=[list(map(int,input().split())) for i in range(N)]
mincost=10**5
for i in range(N):
    if c[i][1]>T:
        continue
    else:
        if c[i][0]<mincost:
            mincost=c[i][0]
print(mincost if mincost!=10**5 else 'TLE')

Submission status: Accepted

Solution code:
n,t=[int(i) for i in input().split()]
l=[]
def f(l,L,t):
  if L[1] <= t:
    l.append(L[0])
  return l
for i in range(n):
  L=[int(i) for i in input().split()]
  f(l,L,t)
if l==[]:
  print("TLE")
else:
  print(min(l))

Submission status: Accepted

Solution code:
import math
import string


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


def nCr(n, r):
    return math.factorial(n)//math.factorial(n-r)*math.factorial(r)


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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

ct = [[int(i) for i in input().split()] for _ in range(n)]

x=[]
for i in range(n):
  if ct[i][1] <= t:
    x.append(ct[i][0])
    
    
x.sort()

if len(x) != 0:
  print(x[0])
else:
  print("TLE")

Submission status: Accepted

Solution code:
n,T=map(int,input().split())
st=[list(map(int,input().split())) for _ in range(n)]
st=sorted(st,key=lambda x:(x[0],x[1]))
for i in range(n):
  if st[i][1]<=T:
    print(st[i][0])
    exit()
print('TLE')

Submission status: Accepted

Solution code:
N, T = map(int, input().split())
cost = float('inf')
FLAG = False

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

if (FLAG):
    print(cost)
else:
    print('TLE')

Submission status: Accepted

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

list_ans = []
for i in range(N) :
    if list_t[i] <= T :
        list_ans.append(list_c[i])

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