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:
def main():
    N, T = (int(x) for x in input().split())
    c=None
    for i in range(N):
        c_tmp, t_tmp = (int(x) for x in input().split())
        if t_tmp<=T:
            if c is None or c_tmp<c:
                c=c_tmp

    if c is None:
        print('TLE')
    else:
        print(c)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys


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

    ans = 10**5

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

    if ans == 10**5:
        print('TLE')
        return

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

list = []
for i in range(0, N):
    c, t = [int(x) for x in input().split()]
    list.append((c, t))

filteredList = [x for x in list if x[1] <= T]

# print(filteredList)

if len(filteredList) >= 1:
    res = min(filteredList, key=lambda x: x[0])
    print(res[0])
else:
    print("TLE")

Submission status: Accepted

Solution code:
# coding: utf-8
TLE_COST = 1010

N, T = [int(s) for s in input().strip().split()]

cost = TLE_COST
for _ in range(N):
    c, t = [int(s) for s in input().strip().split()]
    if t <= T and c < cost:
        cost = c

if cost != TLE_COST:
    print(cost)
else:
    print("TLE")

Submission status: Accepted

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

# c_list = []
# t_list = []

answer = 10000

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

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

Submission status: Accepted

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

Submission status: Accepted

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

a = []

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

min = 9999

for i in a:
    if i[1] <= t and i[0] < min:
        min = i[0]

if min > 1000:
    print("TLE")
else:
    print(min)

Submission status: Accepted

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

cost = 100001
for i in range(N):
    ci, ti = map(int, input().split())
    if ti <= T:
        if cost > ci:
            cost = ci
if cost != 100001:
    print(cost)
else:
    print('TLE')

Submission status: Accepted

Solution code:
def calc(N, T, c, y):
    cost = 1001
    for i in range(N):
        if T >= y[i] and cost > c[i]:
            cost = c[i]
    return cost


def main():
    N, T = list(map(int, input().split()))
    c, y = [], []
    for _ in range(N):
        ct = list(map(int, input().split()))
        c.append(ct[0])
        y.append(ct[1])
    ret = calc(N, T, c, y)
    print([ret,"TLE"][ret==1001])


if __name__ == "__main__":
    main()

Submission status: Accepted

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

ans = "TLE"

for i in range(n):
    cc, tt = map(int, input().split())
    if tt <= t:
        if ans == 'TLE':
            ans = cc
        else:
            ans = min(ans, cc)

print(ans)

Submission status: Accepted

Solution code:

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

c_list = []
t_list = []

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

n_min = 1001

for i, j in zip(c_list, t_list):
    if j <= t and i < n_min:
        n_min = i

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

Submission status: Accepted

Solution code:
# coding: utf-8


def main():
    n, t = map(int, input().split())
    clist = []
    for _ in range(n):
        c, tt = map(int, input().split())
        if tt <= t:
            clist.append(c)

    if not clist:
        print('TLE')
    else:
        print(min(clist))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
n,s = map(int,input().split())
f = 0
m = 1001
for _ in [0]*n:
  c,t = map(int,input().split())
  if t<=s:
    f = 1
    m = min(m,c)
if f == 0:
  print("TLE")
else:
  print(m)

Submission status: Accepted

Solution code:
nt = input().split(' ')
N = int(nt[0])
T = int(nt[1])

cc = [[0, 0] for x in range(N)]
for i in range(N):
    c = input().split(' ')
    cc[i][0] = int(c[0])
    cc[i][1] = int(c[1])

min_cost = -1
for c1, c2 in sorted(cc):
    if c2 <= T:
        min_cost = c1
        break

print (min_cost if min_cost != -1 else 'TLE')

Submission status: Accepted

Solution code:
n,t=map(int,input().split())
l=[]
for i in range(n):
    l.append([j for j in map(int,input().split())])
    
a=1001
for i in l:
    if i[1] <= t and i[0] < a:a=i[0]
if a > 1000:
    a = 'TLE'
print(a)

Submission status: Accepted

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

import numpy as np

data = np.array([[int(i) for i in input().split()]for j in range(n)])

data = data[data[:,1]<=t][:,0]

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

Submission status: Accepted

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

c = []
t = []
for n in range(N):
    inputs = input().split()
    c.append(int(inputs[0]))
    t.append(int(inputs[1]))

min_cost = "TLE"
for i in range(N):
    if t[i] <= T and (min_cost is "TLE" or c[i] <= min_cost):
        min_cost = c[i]

print(min_cost)

Submission status: Accepted

Solution code:
n,t=map(int,input().split())
a=[list(int(i) for i in input().split())for i in range(n)]
ans=float("inf")
for i in range(n):
    if a[i][1]<=t:
        cost=a[i][0]
        ans=min(cost,ans)
if ans==float("inf"):
    print("TLE")
else:
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,T = map(int, input().split())
e = [[int(i) for i in input().split()] for i in range(N)]
minc=1001
for v in e:
	if v[0]<minc and v[1]<=T:
		minc = v[0]
if minc == 1001:
	print("TLE")
else:
	print(minc)

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

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

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

Submission status: Accepted

Solution code:

i = 1
min = 10000000
N, T = map(int, input().split())

while True:
    c, d = map(int, input().split())
    if d <= T:
        if c < min:
            min = c
    if i == N:
        break
    i += 1


if min == 10000000:
    print("TLE")
else:
    print(min)

Submission status: Accepted

Solution code:
N, T = list(map(int, input().split()))
array = [list(map(int,input().split())) for i in range(N)]
list =[ 9999 for i in range(N)]
for i in range(N):
    if array[i][1] <= T:
        list.append(array[i][0])

if(min(list) == 9999):
    print("TLE")
else:
    print(min(list))

Submission status: Accepted

Solution code:
n, t = map(int, input().strip().split())
ans = 1e9
for i in range(n):
  x, y = map(int, input().strip().split())
  if y <= t:
    ans = min(x, ans)
print(ans if ans < 1e6 else 'TLE')

Submission status: Accepted

Solution code:

init = map(int, raw_input().split())
found = False
for loopnum in range(init[0]):
	scanline = map(int, raw_input().split())
	if scanline[1] <= init[1]: 
		if found == False:
			mincost = scanline[0]
			found = True
		else:
			if scanline[0] < mincost:
				mincost = scanline[0]

if found == False:
	print "TLE"
else:
	print mincost

Submission status: Accepted

Solution code:
N,T=map(int,input().split())
c=[]
t=[]
min=10000
for i in range(N):
    c_n,t_n=map(int,input().split())
    c.append(c_n)
    t.append(t_n)
for i in range(N):
    if (t[i]<T or t[i]==T) and c[i]<min:
        min=c[i]
if min != 10000:
    print(min)
else:
    print("TLE")

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

N= list(map(int,input().split())) #１行目の入力

root_list = []
cost = 1001
for i in range(N[0]):
    root_list.append(list(map(int,input().split())))

    if root_list[i][1] <= N[1]:
        if root_list[i][0] < cost:
            cost = root_list[i][0]


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

Submission status: Accepted

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

ans = 12345

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

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

Submission status: Accepted

Solution code:
# ANSHUL GAUTAM
# IIIT-D

from math import *
from string import *
from itertools import *
from copy import *

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

Submission status: Accepted

Solution code:
n, t = map(int, input().split())
cmin = 999999
for _ in range(n):
	ci, ti = map(int, input().split())
	if ti <= t and ci < cmin:
		cmin = ci
if cmin <= 1000:
	print(cmin)
else:
	print("TLE")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
N, T = (int(_) for _ in input().split())
e = [[int(i) for i in input().split()] for i in range(N)]
T_list=[]
for j in range(N):
  if e[j][1]<=T:
    T_list.append(e[j][0])
if len(T_list)==0:
  print ("TLE")
else:
  print (np.min(T_list))

Submission status: Accepted

Solution code:
inN,inT = list(map(int,input().split()))
outC = 1001
for i in range(inN):
  inCi,inTi = list(map(int,input().split()))
  if inTi <= inT and inCi < outC:
    outC = inCi

if outC != 1001:
  print(outC)
else:
  print("TLE")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
nt = map(int, raw_input().split())
cheapest = 1001
for i in range(nt[0]):
    ct = map(int, raw_input().split())
    if ct[1] <= nt[1]:
        if ct[0] < cheapest:
            cheapest = ct[0]
if cheapest == 1001:
    print("TLE")
else:
    print(cheapest)

Submission status: Accepted

Solution code:
N, T = map(int, input().split())
c_min = 1000
count = 0
for i in range(N):

    c, t = map(int, input().split())
    if t <= T and c <= c_min:
        count += 1
        c_min = c
if count == 0:
    print('TLE')
else:
    print(c_min)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, T = map(int, input().split())
l = [list(map(int, input().split())) for val in range(N)]
l2 = [l[n][0] for n in range(N) if l[n][1] <= T]
l2.sort()
if not l2:
    print("TLE")
else:
    print(l2[0])

Submission status: Accepted

Solution code:
l = input().split()
c = []
t = []
for i in range(int(l[0])):
    c1,t1 = [int(i) for i in input().split()]
    c.append(c1)
    t.append(t1)
cost = 10000
for i in range(int(l[0])):
    if t[i] <= int(l[1]):
        if c[i] <= cost:
            cost = int(c[i])
if cost == 10000:
    print('TLE')
else:
    print(cost)

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:
# coding: utf-8

N,T = map(int,input().split())
moto=[]
mini = []
for i in range(N):
    c,t = map(int,input().split())
    if t<=T:
        mini.append(c)
if len(mini) >= 1:
    print(min(mini))
else:
    print("TLE")

Submission status: Accepted

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

DEKAI = 1<<30
MIN = DEKAI
for i in range(n):
    if t[i] <= T:
        MIN = min(MIN, c[i])

if MIN == DEKAI:
    print("TLE")
else:
    print(MIN)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
INF = 2**30
n, T = map(int, raw_input().split())
best = INF
for i in range(n):
    c, t = map(int, raw_input().split())
    if t <= T:
        best = min(best, c)
print "TLE" if best == INF else best

Submission status: Accepted

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

min_c = 1001
min_c_i = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

for c,t in list:
    if t <= T:
        cnt += 1
        comp_cost = c
        if comp_cost < min_cost:
            min_cost = comp_cost

if cnt >= 1:
    print(min_cost)
elif cnt == 0:
    print('TLE')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
list = input().split()
list = [int(s) for s in list]

N = list[0]
T = list[1]

c = [0]*N
t = [0]*N

for i in range(N):
    templist = input().split()
    templist = [int(s) for s in templist]
    c[i] = templist[0]
    t[i] = templist[1]

    i = i + 1

n = 0

for i in range(N):
    if t[i] <= T:
        n = n + 1
    
    i = i + 1

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

else:

    d = [0]*n
    k = 0

    for i in range(N):
        if t[i] <= T:
            d[k] = c[i]
            k = k + 1

    m = d[0]

    for j in range(n):
        if m >= d[j]:
            m = d[j]
    
        j = j + 1

    print(m)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

cost = 1000
check = -1
for i in range(N):
    if t[i] <=T and c[i] <= cost:
        check = i
        cost = c[i]
        #print(i)
        #print(cost)

if check == -1:
    print('TLE')
else:
    print(cost)

Submission status: Accepted

Solution code:
N, T = map(int, input().split())
cost = 1001
for i in range(N):
    ci, ti = map(int, input().split())
    if ti <= T and cost > ci:
        cost = ci
if cost > 1000:
    print('TLE')
    exit()
print(cost)

Submission status: Accepted

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

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

cost = 0

for i in range(N):
    if array[i][1] <= T and (cost == 0 or cost > array[i][0]):
        cost = array[i][0]
if cost == 0:
    print('TLE')
    exit()
print(cost)

Submission status: Accepted

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

for i in range(len(ct)):
    if ct[i][1]>T:
        continue
    else:
        print(ct[i][0])
        exit(0)
print('TLE')

Submission status: Accepted

Solution code:
n,T=map(int,input().split())
c=[]
t=[]
ans=2e31-1
for i in range(n):
    c,t=map(int,input().strip().split(' '))
    if t<=T:
        ans=min([ans,c])
if  ans==2e31-1:
    print("TLE")
else:
    print(ans)

Submission status: Accepted

Solution code:
import sys
N, T0 = map(int, sys.stdin.readline().split(" "))
L = sys.stdin.readlines()

isFound = False
ans = 0

for item in L:
  c, t = map(int, item.split(" "))
  if t <= T0:
    if isFound == False:
      ans = c
    else:
      ans = min(c, ans)
    isFound = True

if isFound == False:
  print("TLE")
else:
  print(str(ans))

Submission status: Accepted

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

for i in range(N):
    t = [int(i) for i in input().split(" ")]
    if t[1] <= T:
        c.append(t[0])
        t.append(t[1])

if c == []:
    print("TLE")
else:
    print(min(c))

Submission status: Accepted

Solution code:
N, T = map(int, input().split()) # 1. スペース区切りの入力を受け取る
# 2. 上記の入力に伴ってデータがくるからそれを集めるために配列を宣言
c = []
t = []
for i in range(N): # 3.loop 変数iを用意し、0からN-1までの範囲でループが回る
    tmp = [0, 0] # 4. tempというリストよ用意する
    tmp[0], tmp[1] = map(int, input().split()) # 5. 入力をうけとる
    # 6. tmpリストに入っているデータを0,1の順でc,tに代入
    c.append(tmp[0])
    t.append(tmp[1])
index = -1 # 7. 番兵法を使う
cost = 1000 # 8 costの上限を代入しておく
for i in range(N): # 9.loop. 再びN-1までの範囲でループを回す
    if t[i] <= T and c[i] <= cost: # 10. 最小経路を探す
        index = i
        cost = c[i]
if index == -1: # indexが書き換わっていなければ、エラー
    print('TLE')
else:
    print(cost)

Submission status: Accepted

Solution code:
N, T = map(int, input().split())
c = []
t = []
for i in range(N):
    tmp = [0, 0]
    tmp[0], tmp[1] = map(int, input().split())
    c.append(tmp[0])
    t.append(tmp[1])
index = -1
cost = 1000
for i in range (N):
    if t[i] <= T and c[i] <= cost:
        index = i
        cost = c[i]
if index == -1:
    print('TLE')
else:
    print(cost)

Submission status: Accepted

Solution code:
n,l = map(int, raw_input().split())
mn = 2000
for _ in range(n):
    c,t = map(int, raw_input().split())
    if t <= l:
        mn = min(mn,c)
if mn == 2000:
    print 'TLE'
else:
    print mn

Submission status: Accepted

Solution code:
n, t = map(int, raw_input().split())
z = 9999
for i in range(n):
	a, b = map(int, raw_input().split())
	if b <= t:
		z = min(z, a)
if z == 9999:
	print 'TLE'
else:
	print z

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n,t = map(int,input().split())
ans_cost = 10000
ans_time = t

for i in range(n):
    a,b = map(int,input().split())
    if b<=ans_time:
        if a<ans_cost:
            ans_cost = a


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

Submission status: Accepted

Solution code:
n, t = map(int, input().split())
save = 10000
for _ in range(n):
  ci, ti = map(int, input().split())
  if ti <= t and ci < save:
    save = ci

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

Submission status: Accepted

Solution code:
n,t = map(int,input().split())
min = 100000
for i in range(n):
  c,long = map(int,input().split() )
  if t >= long and min > c:
    min = c
if min == 100000:
  print("TLE")
else:
  print(min)

Submission status: Accepted

Solution code:
N,T=map(int,input().split())
s=2000
for i in range(N):
    a,b=map(int,input().split())
    if b<=T:s=min(s,a)
print(s if s<2000 else "TLE")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for c, t in ct:
    if t <= T:
        mi = min(c, mi)

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

Submission status: Accepted

Solution code:
N, T = map(int, raw_input().split())
small_c = 10000
for i in range(N):
  c, t = map(int, raw_input().split())
  if t <= T:
    if c < small_c:
      small_c = c
if small_c > 1000:
  print('TLE')
else:
  print(small_c)

Submission status: Accepted

Solution code:
# Time limit Exceeded
n, largeT = map(int, input().split())
c = []
t = []
ans = []
for i in range(n):
    c, t = map(int, input().split())
    if t <= largeT:
        ans.append(c)
try:
    print(min(ans))
except ValueError:
    print('TLE')

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

while(N):
    c,t=input().split()
    c=int(c)
    t=int(t)
    if(t<=T):
        if(ans==None):
            ans=c
        else:
            ans=min(ans,c)
    N-=1

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

Submission status: Accepted

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

cost = 1001
flag = False

for i in range(n):
    if li[i][1] <= t:
        flag = True
        if li[i][0] < cost:
            cost = li[i][0]

if flag == True:
    print(cost)
else:
    print("TLE")

Submission status: Accepted

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

Submission status: Accepted

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

for c in l:
    if c[1]<=n:
        e.append(c[0])

if not e:
   print("TLE")
else: 
    print(min(e))

Submission status: Accepted

Solution code:
# -*- coding : utf-8 -*-
N, T = map(int, input().split(" "))

c = [int(1001)]

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

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

Submission status: Accepted

Solution code:
n, T = map(int, input().split())
res = 2000
for _ in range(n):
  c, t = map(int, input().split())
  if t > T: continue
  res = min(res, c)
if res == 2000:
  print('TLE')
else:
  print(res)

Submission status: Accepted

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

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

if ans == 10000:
  ans = "TLE"

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

N,T = inpl()
ans = INF
for i in range(N):
    c,t = inpl()
    if t <= T:
        ans = min(c,ans)

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

Submission status: Accepted

Solution code:
N, T = map(int,input().split())
c = list()
t = list()
for _ in range(N):
    ci, ti = map(int, input().split())
    if ti <= T:
        c.append(ci)
        t.append(ti)

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

Submission status: Accepted

Solution code:
N, T = map(int,input().split())
c = list()
t = list()
for _ in range(N):
    ci, ti = map(int, input().split())
    c.append(ci)
    t.append(ti)

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

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

Submission status: Accepted

Solution code:
N,T = (int(i) for i in input().split())
result = list()
for ii in range(N):
    c,t = (int(i) for i in input().split())
    if t <= T:
        result.append(c)
    else:
        continue
if result:
    result.sort()
    print(result[0])
else:
    print("TLE")

Submission status: Accepted

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

a =[]
for i in range(n):
    if li[i][1] <= t:
        a.append(i)
#print(a)
b = []
for i in a:
    b.append(li[i][0])
#print(b)
if b:
    print(min(b))
else:
    print("TLE")

Submission status: Accepted

Solution code:
NT=[int(i) for i in input().split()]
ct=[[int(j) for j in input().split()] for i in range(NT[0])]

ans=0
for i in range(NT[0]):
	if ct[i][1]<=NT[1]:
		if ct[i][0]<ct[ans][0]:
			ans=i
if ct[ans][1]<=NT[1]:
	print(ct[ans][0])
else:
	print("TLE")

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
def read():
    return int(input())


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


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


N, T = readmap()
c = []
t = []
for _ in range(N):
    ci, ti = readmap()
    c.append(ci)
    t.append(ti)

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

if ans > 1000:
    print("TLE")
else:
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, T =  map(int, input().split())
n = []
t = []
ans = None
for i in range(N):
    ni, ti = map(int, input().split())
    n.append(ni)
    t.append(ti)

for i in range(N):
    if not T < t[i]:
        if ans == None:
            ans = n[i]
        elif ans > n[i]:
            ans = n[i]

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

Submission status: Accepted

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

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

Cost, Time = ct[0]
for c, t in ct:
    if t <= T and Cost >= c:
        Cost = c
        Time = t

if Time <= T:
    print(Cost)
else:
    print('TLE')

Submission status: Accepted

Solution code:
I=lambda:map(int,input().split())
n,k=I()
s=1001
for i in range(n):
  a,b=I()
  if b<=k:
    s=min(s,a)
if s==1001:
  print('TLE')
else:
  print(s)

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:
        Ans = min(Ans,c)

print(Ans if Ans != 9999 else "TLE")

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 c < minc and t <= T:
        minc = c
        
if minc==1001:
    print("TLE")
else:
    print(minc)

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

c = min((c for c, t in ct if t <= T), default='TLE')
print(c)

Submission status: Accepted

Solution code:
N, T = map(int,input().split())
mincost = 100000
for i in range(N):
    ci, ti = map(int,input().split())
    if ti <= T:
            mincost = min(mincost,ci)

if mincost == 100000:
    print('TLE')
else:
    print(mincost)