Problem:


Score : 200 points

Problem Statement

When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC.

You, the smartwatch, has found N routes to his home.

If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i.

Find the smallest cost of a route that takes not longer than time T.

Constraints

All values in input are integers.

1 \leq N \leq 100

1 \leq T \leq 1000

1 \leq c_i \leq 1000

1 \leq t_i \leq 1000

The pairs (c_i, t_i) are distinct.

Input

Input is given from Standard Input in the following format:

N T
c_1 t_1
c_2 t_2
:
c_N t_N

Output

Print the smallest cost of a route that takes not longer than time T.

If there is no route that takes not longer than time T, print TLE instead.

Sample Input 1

3 70
7 60
1 80
4 50

Sample Output 1

4

The first route gets him home at cost 7.

The second route takes longer than time T = 70.

The third route gets him home at cost 4.

Thus, the cost 4 of the third route is the minimum.

Sample Input 2

4 3
1 1000
2 4
3 1000
4 500

Sample Output 2

TLE

There is no route that takes not longer than time T = 3.

Sample Input 3

5 9
25 8
5 9
4 10
1000 1000
6 1

Sample Output 3

5



Sample input:
3 70
7 60
1 80
4 50


Sample output:
4

Submission status: Accepted

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

flag = False
mins = 10000
for i in range(N):
  s, t = list(map(int, input().split()))
  if T >= t:
    mins = s if mins > s else mins
    flag = True
    
print(mins if flag is True else 'TLE')

Submission status: Accepted

Solution code:
N,T=map(int,input().split())
A=[list(map(int,input().split())) for i in range(N)]
B=sorted(A)
cnt=0
for i in range(N):
  if B[i][1]<=T:
    print(B[i][0])
    exit()
  else:
    cnt+=1
if cnt==N:
  print('TLE')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

inf = float('inf')

n, T, *ct = map(int, sys.stdin.read().split())
ct = zip(*[iter(ct)] * 2)

def main():
    res = inf
    for c, t in ct:
        if t <= T:
            res = min(res, c)
    
    return res if res != inf else 'TLE'

if __name__ == '__main__':
    ans = main()
    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(ans,c)

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

Submission status: Accepted

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

y = []

for i in x:
  if i[1] <= t:
    y.append(i)

y.sort()

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

Submission status: Accepted

Solution code:
N, T = map(int, input().split())
c_t_list = [list(map(int, input().split())) for _ in range(N)]
c_t_list = [c_t for c_t in c_t_list if c_t[1] <= T]
if c_t_list:
    print(sorted(c_t_list)[0][0])
else:
    print('TLE')

Submission status: Accepted

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

Submission status: Accepted

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

cl = []
tl = []

for i in range(n):
    cw,tw = map(int, input().split())

    if tw <= t:
        cl.append(cw)
        tl.append(tw)

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
N, T = map(int, input().split())
min = 1000
flag = False
for i in range(N):
    c, t = map(int, input().split())
    if t <= T and c <= min:
        min = c
        flag = True
if flag:
    print(min)
else:
    print("TLE")

Submission status: Accepted

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

Submission status: Accepted

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

cost = []

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
 
import math
import itertools
import sys
import copy
 
# 入力
#A, B, C, D = map(int, input().split())
#L = list(map(int, input().split()))
#S = list(str(input()))
#N = int(input())
N, T = map(int, input().split())
L = []
for _ in range(N) :
  L.append(list(map(int, input().split())))
#print (L)

ans = sys.maxsize
TLEflag = True
for i in range(N) :
  if L[i][1] <= T :
    ans = min(ans, L[i][0])
    TLEflag = False

if TLEflag == True :
  print ("TLE")
else :
  print (ans)

Submission status: Accepted

Solution code:
N,T=map(int,input().split())
ct=[list(map(int,input().split())) for _ in range(N)]
ans_l=[]
for i in range(N):
    if ct[i][1]<=T:
        ans_l.append([ct[i][0],i+1])
if ans_l==[]:
    print('TLE')
else:
    len_ans_l=len(ans_l)
    ans=float('inf')
    for i in range(len_ans_l):
        if ans_l[i][0]<ans:
            ans=ans_l[i][0]
    print(ans)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
N,T = [int(i) for i in input().split()]
minc = 100000
for i in range(N) :
    c,t = [int(i)for i in input().split()]
    if t > T :
        continue
    else :
        minc = min(minc,c)
if minc == 100000 :
    print("TLE")
else :
    print(minc)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

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

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353


N , t = list(map(int, sys.stdin.buffer.readline().split()))
C, T  = list(zip(*[map(int, sys.stdin.buffer.readline().split()) for _ in range(N)]))

C = np.array(C, dtype=int)
T = np.array(T, dtype=int)

if np.any(T <= t):
    ans = C[T <= t].min()
    print(ans)
else:
    print('TLE')

Submission status: Accepted

Solution code:
import sys
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")
    sys.exit()

cost = float("inf")
for i in range(N):
    if t[i] <= T:
        cost = min(cost, c[i])
print(cost)

Submission status: Accepted

Solution code:
n, t = map(int, input().split())
x = []
for i in range(n):
    a, b = map(int, input().split())
    if t >= b:
        x.append(a)

if 0 < len(x):
    print(min(x))
else:
    print('TLE')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

A = []
for i in range(n):
    c, t_ = map(int, input().split())
    if t_ <= t:
        A.append(c)

if len(A) >= 1:
    print(min(A))
else:
    print("TLE")

Submission status: Accepted

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

INF=2**51+1
ans=INF
for k in range(N):
    if t[k]<= T:
        ans = min(ans, c[k])
        
if ans==INF:
    print("TLE")
else:
    print(ans)

Submission status: Accepted

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

for c, t in lst:
    if t <= T:
        tmp = min(tmp, c)

print(tmp) if tmp != 9999 else print('TLE')

Submission status: Accepted

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

for i in range(N):
    c, t = map(int, input().split())
    if t > T :
        continue
    else:
        costs.append(c)

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

Submission status: Accepted

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

ans = -1
cst = 10**5
for i in range(n):
    c,tm = map(int,input().split())
    if tm <= t and c <cst:
        cst = c
        ans = c

if ans == -1:
    print("TLE")
else:
    print(ans)

Submission status: Accepted

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

for i in range(N):
    lst.append(x[i][1])

if min(lst) <= T:
    for i in range(N):
        if x[i][1] <= T:
            lst2.append(x[i][0])

    print(min(lst2))

else:
    print('TLE')

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(n):
	c, t = map(int,input().split())
	if t > T:
		continue
	if ans_c >= c:
		ans_c, ans_t = c, t
	
print(ans_c if ans_t != 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)]
c_l=[]
for i in range(n):
    c_i=l[i][0]
    t_i=l[i][1]
    if t_i<= t:
        c_l.append(c_i)
if len(c_l)==0:
    print("TLE")
else:
    print(min(c_l))

Submission status: Accepted

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

for lst in lstct:
    if lst[1] <= t:
        ans = min(ans,lst[0])
else:
    if ans == 1001:
        ans = "TLE"

print(ans)

Submission status: Accepted

Solution code:
import math
import collections
import itertools
import sys
import bisect
from heapq import heappop,heappush,heapify
sys.setrecursionlimit(10**6)
def MAP(): return list(map(int,input().split()))
def INT(): return int(input())
def FLOAT(): return float(input())
MOD = 10**9+7
INF = 10**9

n,T = MAP()
ans = INF
for i in range(n):
    c,t = MAP()
    if t<=T:
        ans = min(c,ans)
if ans==INF:
    print("TLE")
else:
    print(ans)

Submission status: Accepted

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

ans = 10**9

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

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

Submission status: Accepted

Solution code:
#coding:utf-8
N, T = map(int, input().split())
#ありえるコストの最大値+1で初期化しておく
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=map(int, input().split())
a=[]
for i in range(n):
    c,s=map(int, input().split())
    if s<=t:
        a.append(c)
    continue
if len(a)==0:
    print('TLE')
else:
    print(min(a))

Submission status: Accepted

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

Submission status: Accepted

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


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

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

Submission status: Accepted

Solution code:
n,t=map(int,input().split())
tici=[]
for i in range(n):
	ci,ti=map(int,input().split())
	if(ti<=t):
		tici.append([ci,ti])
if(len(tici)==0):
	print('TLE')
else:
	tici.sort()
	print(tici[0][0])

Submission status: Accepted

Solution code:
n, T = map(int, input().split())
TLE = 0
Min = 100000
for i in range(n):
    c, t = map(int, input().split())
    if t <= T:
        Min = min(Min, c)
        TLE += 1
if TLE==0:
    print("TLE")
else:
    print(Min)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(n):
  if k[i][-1]<=t:
    cost=k[i][0]
    mincost=min(mincost,cost)
if mincost==1000000:
  print("TLE")
else:
  print(mincost)

Submission status: Accepted

Solution code:
ans = 10000
N, T = map(int, input().split())
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 = list(map(int,input().split()))
C = [list(map(int, input().split())) for i in range(N)]
ans = 10000
C = sorted(C,key=lambda x:x[0])
for i in range(N):
  if C[i][1] <= T:
    ans = C[i][0]
    break
if ans == 10000:
  print("TLE")
else:
  print(ans)

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(N):
    cost, time = map(int, input().split())
    if time > T:
        continue
    else:
        costs.append(cost)
if len(costs) != 0:
    print(min(costs))
else:
    print('TLE')

Submission status: Accepted

Solution code:
N,T=map(int,input().split())
lst=[0]*N
a=0
b=0
min_c=float("inf")
t=0
for i in range(N):
    a,b=map(int,input().split())
    if b<=T:
        min_c=min(min_c,a)
if min_c==float("inf"):
    min_c="TLE"
print(min_c)

Submission status: Accepted

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

stt = []
for i in ct:
    if i[1] <= t:
        stt.append(i[0])
if len(stt) == 0:
    print("TLE")
else:
    ans = min(stt)
    print(ans)

Submission status: Accepted

Solution code:
import sys

n, t = map(int, sys.stdin.readline().split())
l = [tuple(map(int, sys.stdin.readline().split())) for _ in range(n)]

ans = 10000000000000000000
flag = False
for cost, time in l:
    if time > t:
        continue

    if cost < ans:
        ans = cost
        flag = True

if flag:
    print(ans)
else:
    print("TLE")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,T=map(int,input().split())
a=[]
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())
l = [list(map(int, input().split())) for i in range(n)]
l.sort(key=lambda x: x[1])
ans = 9999999999
if l[0][1] > t:
    print("TLE")
else:
    for i in range(n):
        if l[i][1] <= t:
            ans = min(ans, l[i][0])
    print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N, T = map(int,input().split())
a = []
for i in range(N):
    a.append([int(i) for i in input().split()])

ans = []
x = 0
for i in range(N):
    if a[i][1] > T:
        x += 1
    if a[i][1] <= T:
        ans.append(a[i][0])

if x == N:
    print("TLE")
else:
    print(min(ans))

Submission status: Accepted

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

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

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

Submission status: Accepted

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

min_cost = float("inf")
for c_t in c_t_list:
    if c_t[1] <= T:
        min_cost = min(min_cost, c_t[0])
if min_cost == float("inf"):
    print("TLE")
else:
    print(min_cost)

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)
result = []
for j in range(N):
  if T >= t[j]:
    result.append(c[j])
  else:
    None
print(min(result) if len(result) > 0 else "TLE")

Submission status: Accepted

Solution code:
def examA():
    N = I()
    if N==1:
        ans = "Hello World"
    elif N==2:
        A = I(); B = I()
        ans = A + B
    try:
        print(ans)
    except:
        print()
    return

def examB():
    N, T = LI()
    ans =  10**9
    for _ in range(N):
        c, t = LI()
        if T>=t and ans>c:
            ans = c
    if ans==10**9:
        ans = "TLE"
    print(ans)
    return

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

if __name__ == '__main__':
    examB()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
import numpy as np
input = sys.stdin.readline
N, T = [int(x) for x in input().split()]
C = []
for _ in range(N):
    temp = [int(x) for x in input().split()]
    C.append(temp)
ans = []
for i in C:
    c, t = i
    if t <= T:
        ans.append(c)
if len(ans) > 0:
    print(min(ans))
else:
    print("TLE")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
q = 100000
for i in range(A):
  S = list(map(int,input().split()))
  if S[1] <= B and S[0] < q:
    q=S[0]
  else:
    pass
if q < 10000:
  print(q)
else:
  print('TLE')

Submission status: Accepted

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

Submission status: Accepted

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

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

#タプルを要素にもつリストのループ処理
#タプルの第二要素がt以下ならリスト格納
k = [c for c,s in [(I()) for _ in [0]*n] if s<=t]
print(min(k) if k!=[] else "TLE")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n,t = map(int,input().split())
routes = [list(map(int,input().split())) for _ in range(n)]
routes = sorted(routes,key=lambda x:x[0])
ans = "TLE"
for i in range(n):
  if routes[i][1] <= t:
    ans = str(routes[i][0])
    break
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(ans,c)
if ans == 10000:
    print('TLE')
else:
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, T = map(int,input().split())
c0 = 1000
p = False
for i in range(n):
    c, t = map(int, input().split())
    if t <= T and c0 >= c:
        p = True
        c0 = c
if p:
    print(c0)
else:
    print('TLE')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, t = map(int, input().split())
lc = []
lt = []
for i in range(n):
    c, tt = map(int, input().split())
    lc.append(c)
    lt.append(tt)

cost = 1001
for i in range(n):
    if lt[i] <= t:
        if lc[i] < cost:
            cost = lc[i]
if cost == 1001:
    print('TLE')
else:
    print(cost)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations
import sys
import bisect
import string
import math
import time
from fractions import gcd
#import random


def I(): return int(input())


def MI(): return map(int, input().split())


def LI(): return [int(i) for i in input().split()]


def LI_(): return [int(i)-1 for i in input().split()]


def StoI(): return [ord(i)-97 for i in input()]


def ItoS(nn): return chr(nn+97)


def input(): return sys.stdin.readline().rstrip()


def show(*inp, end='\n'):
    if show_flg:
        print(*inp, end=end)


YN = ['Yes', 'No']
MOD = 10**9+7
inf = float('inf')
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10**6)


show_flg = False
# show_flg = True


def main():
    N, T = MI()
    cur = int(10**9)

    for i in range(N):
        c, t = MI()
        if t <= T and cur > c:
            cur = c

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import numpy as np
N, T, *ct = map(int, open(0).read().split())

ct = np.array(ct).reshape((N, 2))
ct = ct[ct[:,1] <= T]

if ct.shape[0] == 0:
  print('TLE')
else:
  print(min(ct[:,0]))

Submission status: Accepted

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

ans = 1001

for i in range(n):
    if ls_ct[i][0] <= ans and ls_ct[i][1] <= t:
        ans = ls_ct[i][0]
        
if ans == 1001:
    print("TLE")
else:
    print(ans)

Submission status: Accepted

Solution code:
##### 解けた #####

N,T=list(map(int,input().split(" ")))
minc,mint=1001,0

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

    if t<=T: # T以内に帰宅できる
        minc=min(minc,c)

if minc<=1000: # 最小値が存在するなら
    print(minc)
else: # どの経路もダメな場合
    print("TLE")

Submission status: Accepted

Solution code:
N, T = map(int, input().split())
is_inT = False
min_c = 1000
for i in range(N):
    ct_i = [int(i) for i in input().split()]
    if ct_i[1] <= T:
        is_inT = True
        min_c = min(min_c, ct_i[0])
if is_inT:
    print(min_c)
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:
        ans=min(ans,c)

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

Submission status: Accepted

Solution code:
#テストファイルで実行する時
import sys
if sys.platform =='ios':
    sys.stdin=open('input_file.txt')

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

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

min = 100000

for i in range(n):
	if c[i][1] <= t:
		if c[i][0] < min:
			min = c[i][0]

print(min if min!=100000 else 'TLE')

Submission status: Accepted

Solution code:
def inpl(): return list(map(int, input().split()))
N, T = inpl()
ans = 10**9

for _ in range(N):
    c, t = inpl()
    if t <= T:
        ans = min(ans, c)
if ans < 10**9:
    print(ans)
else:
    print("TLE")

Submission status: Accepted

Solution code:
n,time_max = map(int,input().split())
cost = []
time = []
for i in range(n):
  a = input().split()
  cost.append(int(a[0]))
  time.append(int(a[1]))

while True:
  min_index = cost.index(min(cost))
  if time[min_index] <= time_max:
    print(cost[min_index])
    break
  elif cost[min_index] == 1001:
    print("TLE")
    break
  else:
    cost[min_index] = 1001

Submission status: Accepted

Solution code:
nums = list(map(int, input().split())) # "1 2 3"と入力
n = nums[0]
t = nums[1]
minC = 1001
for i in range(n):
    numss = list(map(int, input().split()))
    c = numss[0]
    ti = numss[1]
    if ti <= t and minC > c:
        minC = c
if minC == 1001:
    print('TLE')
else:
    print(minC)

Submission status: Accepted

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

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

cost_now = 10000
for i in range(n):
	if cost_times[i][1] > t:
		continue
	elif cost_times[i][0] < cost_now:
		cost_now = cost_times[i][0]

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

Submission status: Accepted

Solution code:
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

N,T = inpl()
ans = INF
for _ in range(N):
    c,t = inpl()
    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())
k = [[int(i) for i in input().split()] for _ in range(N)]
ans = float('inf')
for c, t in k:
    if t <= T:
        ans = min(ans, c)
print(ans if ans != float('inf') else 'TLE')

Submission status: Accepted

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

    array = []
    for i in range(n):
        c,t = map(int, input().split())
        if t <= T:
            array.append(c)
    if not array:
        print('TLE')
        return
    print(min(array))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

min_aaa =1001

for i in range(N):
    if T>= list_aaa[i][1]:
        min_aaa = min(min_aaa,list_aaa[i][0])

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

Submission status: Accepted

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

n,t =  (int(x) for x in input().split())

A = []
for i in range(n):
    c,ti  =  (int(x) for x in input().split())
    A.append([c,ti])

A.sort(key=lambda x: x[1])

if A[0][1] > t:
    print("TLE")
else:
    min = A[0][0]
    for i in A:
        if i[1] > t:
            break
        
        if min > i[0]:
            min = i[0]
        
    print(min)

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 = map(int, input().split())
c = []
for _ in range(N):
  x, y = map(int, input().split())
  c.append([x, y])

cost = [10001]
for i in range(N):
  if c[i][1] <= T:
    cost.append(c[i][0])

if min(cost) == 10001:
  print("TLE")
else:
  print(min(cost))