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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

min_c =	1001

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

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

Submission status: Accepted

Solution code:
n,t=map(int,input().split())
a=10000
for i in range(n):
  p,q=map(int,input().split())
  if q <= t and p <= a:
      a = p
if a == 10000:
    print('TLE')
else:
    print(a)

Submission status: Accepted

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

Submission status: Accepted

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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

arr = list(filter(lambda x: x[1] <= T, L))
print(min([x[0] for x in arr]) if arr else 'TLE')

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

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

Submission status: Accepted

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

n, t = na()
ans = 10000
for i in range(n):
    ci, ti = na()
    if ti <= t:
        ans = min(ci, ans)
if ans == 10000:
    print("TLE")
else:
    print(ans)

Submission status: Accepted

Solution code:
import numpy as np
N,T= [int(i) for i in input().split()]
a=[]
for i in range(N):
	a.append( [int(x) for x in input().split()])
a = np.array(a)
a = a[np.where(a[:,1] <= T)]
print(min(a[:,0]) if len(a) > 0 else "TLE")

Submission status: Accepted

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

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



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

Submission status: Accepted

Solution code:
N, T = map(int, input().split())
ans = 10000
for i in range(1, N+1):
  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())
m = 9999
d = 0
for i in range(N):
    c,t = map(int,input().split())
    if t <= T:
        m = min(m,c)
    elif t > T:
        d += 1

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

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:
n, t = map(int, input().split())
c = []
for _ in range(n):
    ct = tuple(map(int, input().split()))
    if ct[1] <= t:
        c.append(ct[0])
if c != []:
    c.sort()
    print(c[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)]

cost = []

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

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

Submission status: Accepted

Solution code:
N, T = map(int, input().split())
min_c = 1001
flag = 0

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

if flag:
  print(min_c)
else:
  print('TLE')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, T, *V = map(int, open(0).read().split())
cs = V[0::2]
ts = V[1::2]
ans = 1001

for i in range(N):
  if(ts[i] > T):
    continue
  if(cs[i] < ans):
    ans = cs[i]

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

if tmp == (114514):
  print("TLE")
else:
  print(tmp)

Submission status: Accepted

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

for h in range(n):
  T.append(ct[h][1])
  
if min(T) > t:
  print("TLE")
  exit()
else:
  for j in range(n):
    if ct[j][1] <= t:
      c = ct[j][0]
      k = j
      break
 

for i in range(k+1,n):
  if ct[i][1] <= t:
    c = min(c,ct[i][0])
    
print(c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from operator import itemgetter
N,T=map(int,input().split())
st=sorted([list(map(int,input().split())) for i in range(N)],key=itemgetter(1))
INF=float("inf")
cost=INF
for cn,tn in st:
  if tn<=T:
    cost=min(cost,cn)
  else:
    break
print("TLE" if cost==INF else 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 c<=min_c and t<=T:
        min_c=c
print(min_c if min_c!=1001 else "TLE")

Submission status: Accepted

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

Submission status: Accepted

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

temp = []
for i in range(N):
    if li[i][1] <= T:
        temp.append(li[i][0])

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, T = map(int, input().rstrip().split())
n = sorted([list(map(int, input().rstrip().split())) for i in range(N)], key=lambda x: x[1])
INF = float("inf")
cost = INF
for cn, tn in n:
    if T >= tn:
        cost = min(cost, cn)
    else:
        break

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

Submission status: Accepted

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

    ans = float('inf')

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

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

main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def test():
    n,t = map(int,input().split())
    c = []
    d = []
    for i in range(n):
        a,b = map(int,input().split())
        c.append(a)
        d.append(b)

    e = {i:j for i,j in zip(c,d)}
    d = [i for i in e if e[i] <= t]

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


if __name__ == "__main__":
    test()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,T=map(int,input().split())
minc=1001
for _ in range(n):
    c, t = map(int, input().split())
    if t<=T and minc>c:
        minc=c
print(minc if minc!=1001 else '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:
n, t = map(int, input().split())

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

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

Submission status: Accepted

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

ct.sort()

for c, t in ct:
  if t <= T:
    print(c)
    exit(0)
print('TLE')

Submission status: Accepted

Solution code:
import sys
n,t=map(int,input().split())
cts=[list(map(int,input().split())) for _ in range(n)]
cts.sort(key=lambda x:(x[0],x[1]))

for ct in cts:
  if ct[-1]<=t:
    print(ct[0])
    sys.exit()

print('TLE')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    N, T = map(int, input().split())
    min_c = float('inf')
    for i in range(N):
        c, t = map(int, input().split())
        if t <= T:
            min_c = min(min_c, c)

    if min_c == float('inf'):
        return "TLE"
    return min_c

if __name__ == '__main__':
    print(main())

Submission status: Accepted

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

Submission status: Accepted

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

print('TLE' if not list else min(list))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, t = map(int, input().split())
cs = []
for _ in range(n):
    c, ti = map(int, input().split())
    if ti <= t:
        cs.append(c)
if cs:
    print(min(cs))
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:
a,b = map(int, input().split())
cl=[]
tl=[]
for i in range(a):
    c,t = map(int, input().split())
    cl.append(c)
    tl.append(t)
    
ind=0
resut_list=[]
for p in range(a):
    if tl[ind]<=b:
        resut_list.append(cl[ind])   
    ind+=1
    
if len(resut_list)==0:
  print("TLE")  

else:
  print(min(resut_list))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x,y = map(int,input().split())

cost = 1001

for i in range(x):
    a,b = map(int, input().split())
    if b <= y:
        cost = min(cost,a)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, T = map(int, input().split())
min = 100000
flg = False
for i in range(N):
    min_temp, T_temp = map(int, input().split())
    if min_temp < min and T_temp <= T:
        min = min_temp
        flg = True
print(min if flg == True else "TLE")

Submission status: Accepted

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

Submission status: Accepted

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

for j in range(n):
    l.append([int(i) for i in input().split()])

c = 1001
c_i = -1

for i in range(n):
    # print('check',l[i])
    if l[i][1] <= t:
        # print('clear condition of time')
        if l[i][0] < c:
            # print('clear condition of cost')
            c = l[i][0]
            c_i = i
            # print(l[c_i],'is top now')

if c_i != -1:
    print(l[c_i][0])
else:
    print('TLE')

Submission status: Accepted

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

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

ans = []
for i, v in enumerate(t):
    if v <= T:
        ans.append(c[i])

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

Submission status: Accepted

Solution code:
N,T=map(int, input().split())
A=[[0]*2 for _ in range(N)]
for i in range(N):
    A[i][1], A[i][0] = map(int,input().split())
A.sort()

import bisect
idx = bisect.bisect_right(A,[T,1001])

if idx==0:
    print('TLE')
else:
    print(min(A[:idx],key=lambda l:l[1])[1])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, T = [int(x) for x in input().split()]
res = 1001
for _ in range(N):
  c, t = [int(x) for x in input().split()]
  if c < res and t <= T:
    res = c

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

Submission status: Accepted

Solution code:
N, T = [int(x) for x in input().split()]
res = 1001
for _ in range(N):
  c, t = [int(x) for x in input().split()]
  if t <= T and c < res:
    res = c

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, t = map(int, input().split())
m = float('inf')
for i in range(n):
  cost, time = map(int, input().split())
  if time <= t:
    m = min(m, cost)
if m == float('inf'):
  print('TLE')
else:
  print(m)

Submission status: Accepted

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

min=50000

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

if min==50000:
    print('TLE')
else:
    print(min)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, T = map(int, input().split())
ct = [list(map(int, input().split())) for _ in range(n)]
li = []
for i in ct:
    if i[1] <= T:
        li.append(i[0])
if len(li) != 0:
    print(min(sorted(li)))
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 = []
for i in ct:
    if i[1] <= T:
        ans.append(i[0])
if len(ans) == 0:
    print('TLE')
else:
    print(min(ans))

Submission status: Accepted

Solution code:
import sys
from fractions import gcd
import bisect
 
stdin = sys.stdin
 
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
s = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)]

n, T = na()
cost = []
for _ in range(n):
        c, t = na()
        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())
ct = []

for i in range(n):
    ct.append(list(map(int, input().split())))

#ct.sort()
minV = 10000
ans = 0

for i in range(n):
    if ct[i][1] > t:
        continue
    elif ct[i][0] < minV:
        minV = ct[i][0]
        ans = i + 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,t=map(int,input().split())
m=1001
for i in range(n):
  a,b=map(int,input().split())
  if b<=t:
    m=min(a,m)
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())

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

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

Submission status: Accepted

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

c_min = 1001
flag = 0
for i in range(n):
    cost,time = map(lambda x:int(x), input().split())
    if time > t:
        pass
    else:
        if cost < c_min:
            c_min = cost
            flag = 1

if flag == 0:
    print("TLE")
else:
    print(c_min)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve():
    N, T = map(int, input().split())
    ct = list(list(map(int, input().split())) for _ in range(N))
    if any([t <= T for c, t in ct]):
        return min([c for c, t in ct if t <= T])
    else:
        return "TLE"


if __name__ == "__main__":
    print(solve())

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, T = map(int, input().split())
ans="TLE"
c_min=1000
for i in range(N):
  c, t = map(int, input().split())
  if t <= T:
    c_min = min(c, c_min)
    ans = c_min
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(M if M != 1001 else 'TLE')

Submission status: Accepted

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

for i in range(n):
    l[i][1],l[i][0]=map(int,input().split())
l.sort()
p=[]
for i in range(n):
    if l[i][0]<=t:
        p.append(l[i][::-1])
if len(p)==0:
    print('TLE')
else:
    p.sort()
    print(p[0][0])

Submission status: Accepted

Solution code:
n, tt = map(int, input().split())
mi = 10 ** 9
for i in range(n):
    c, t = map(int, input().split())
    if tt >= t:
        mi = min(c, mi)
print(mi if mi != 10 ** 9 else "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:cost=min(cost,c)
print("TLE" if cost==1001 else cost)

Submission status: Accepted

Solution code:
n,tl = map(int,input().split())
cost = []
time = []
cost2 = []
for i in range(n):
  c,t = map(int,input().split())
  cost.append(c)
  time.append(t)
for y,z in zip(cost,time):
  if z<=tl:
    cost2.append(y)    
print("TLE" if min(time)>tl else min(cost2))

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,t = map(int,input().split())
inf = 100000000000000
ans = inf
for i in range(n):
    a,b = map(int,input().split())
    if b <= t:
        if ans > a:
            ans = a

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

Submission status: Accepted

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

min_cost=1001
for i in range(n):
  cost,time=list(map(int,input().split()))
  if time <= t:
    min_cost=min(min_cost,cost)
print([min_cost,'TLE'][1000<min_cost])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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 len(array) == 0:
    print("TLE")
else:
    print(min(array))

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

Submission status: Accepted

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

z = sorted(ct, key=lambda x: (x[0],x[1]))
for i in range(n):
    if z[i][1] <= t:
        print(z[i][0])
        exit()
print("TLE")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(n):
    c1, t1 = map(int, input().split())
    c_list.append(c1)
    t_list.append(t1)

ans = 0
for i in range(n):
    if ans == 0:
        if t_list[i] <= t:
            ans = c_list[i]
    else:
        if t_list[i] <= t and c_list[i] < ans:
            ans = c_list[i]

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

Submission status: Accepted

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

list1=[]
for i in range(N):
    X,Y=map(int,list[i].split(" "))
    if Y <= T:
        list1.append(X)
print(min(list1) if list1 != [] else "TLE")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
import copy
import sys

inputa = input().split()
# inputb = input().split()
# inputc = input().split()

a = int(inputa[0])
b = int(inputa[1])
# c = int(inputa[2])

# x = int(inputb[0])
# y = int(inputb[1])

# inputb = input().split()
# inputbList = [int(n) for n in inputb]
#
inputList=[]
inputNumList = []
for i in range(a):
    inputNum = input().split()
    inputNumList = [int(n) for n in inputNum]
    inputList.append(inputNumList)

# inputList = [int(n) for n in inputList]

# b = [int(n) for n in inputb]
# c = [int(n) for n in inputc]

for i in range(a-1, -1, -1):
    if b < inputList[i][1]:
        del inputList[i]

if len(inputList) == 0:
    print("TLE")
else:
    sortedInputList = sorted(inputList, key=lambda n:n[0])
    print(sortedInputList[0][0])

Submission status: Accepted

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

c=1001
for i in range(n):
    ck,tk=input().split()
    if int(tk)<=t and int(ck)<c:
        c=int(ck)
        
if c==1001:
    print("TLE")
else:
    print(c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

n, t = [int(x) for x in input().split()]
ct = [list(map(int,input().split())) for x in range(n)]
target = list(x[0] for x in filter(lambda x:x[1] <= t,ct))
print('TLE' if len(target) == 0 else min(target))

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:
        min_c = min(min_c, _c)

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

Submission status: Accepted

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

c = []
t = []
for _ in range(N):
    _c, _t = map(int, input().split())

    if _t <= T:
        c.append(_c)
        t.append(_t)

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

Submission status: Accepted

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

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