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: Wrong Answer

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

ct = []
for i in range(N):
    ct_input = input()
    ct.append(ct_input)
    
t = 1000
c = 1000
flag = True

for i in range(N):
    cti = ct[i]
    cti = cti.split()
    ci = int(cti[0])
    ti = int(cti[1])
    if t >= ti and T >= ti:
        t = ti
        flag = False
        if c >= ci:
             c = ci



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

Submission status: Wrong Answer

Solution code:
N, T = [int(i) for i in input().split()]
ans = 1500
for i in range(N):
    c1, c2 = [int(j) for j in input().split()]

    if c2 <= T:
        ans = min(c1,ans)

if ans == 1500:
    ans = "LTE"
print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np
NT=list(map(int,input().split()))
N=NT[0]
T=NT[1]
nlist=[]
tlist=[]
for i in range(N):
    listA=list(map(int,input().split()))
    nlist.append(listA[0])
    tlist.append(listA[1])
#indexes = [i for i, x in enumerate(tlist) if x <= T]
npnlist=np.array(nlist)
nptlist=np.array(tlist)
where=np.where(nptlist<=T)
if(where[0]!=[]):
    minmum=10000
    for i in range(len(where[0])):
        if(npnlist[where[0][i]]<minmum):
            minmum=npnlist[where[0][i]]
    print(minmum)
else:
    print("TLE")

Submission status: Wrong Answer

Solution code:
nt = input().split()
ct = ["0"]
for i in range(int(nt[0])):
    inp = input().split()
    if int(inp[1]) <= int(nt[1]):
        ct.extend(list(inp[0]))
ct.sort()
if len(ct) == 1:
    print("TLE")
else:
    print(ct[1])

Submission status: Wrong Answer

Solution code:
n, T = map(int, input().split())
a = []
min_ = 1000
for i in range(n):
    c, t = map(int, input().split())
    a.append(c)
    if t <= T and a[i] <= min_:
        min_ = a[i]
if min_ == 1000:
    print('TLE')
else:
    print(min_)

Submission status: Wrong Answer

Solution code:
nt = input().split()
ct = ["0"]
for i in range(int(nt[0])):
    inp = input().split()
    if int(inp[1]) <= int(nt[1]):
        ct.extend(list(inp[0]))
ct.sort()
print(ct)
if len(ct) == 1:
    print("TLE")
else:
    print(ct[1])

Submission status: Wrong Answer

Solution code:
#encoding utf-8
from operator import itemgetter


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

ct = []
for i in range(n):
    c_0,t_0 = map(int, input().split())
    ct.append([c_0,t_0])

time_flag = 0
for i in range(len(ct)):
    if ct[i][1] < t:
        time_flag += 1
    else:
        ct[i][0] = 1001

ct0=list(ct)
ct.sort(key=itemgetter(0))
# print(ct)

if time_flag == 0:
    print("TLE")
else:
    for i in range(len(ct0)):
        if ct[0] == ct0[i]:
            print(int(i)+1)

Submission status: Wrong Answer

Solution code:
num,limit=input().strip().split(' ')


costs=[]
for i in range(int(num)):
    cost, time = input().strip().split(' ')
    if (int(time) > int(limit)):
        continue
    else:
        costs.append(int(cost))
if costs:
    print(costs)
    print(min(costs))
else:
    print('TLE')

Submission status: Wrong Answer

Solution code:
N,T=(int(i) for i in input().split())
ans=99999999999999
for i in range(N):
	c,t=(int(i) for i in input().split())
	if t <= T:
		if c <= ans:
			ans=c
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
a=input()
c=a.split(" ")
c[0]=int(c[0])
c[1]=int(c[1])
b=[input().split(" ") for x in range(c[0])]

for i in range(len(b)):
    for x in range(2):
        b[i][x]=int(b[i][x])



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


if c[1] < b[0][1]:
    print("TLE")
    sys.exit()
b.sort(key=lambda x:x[0])
for i in range(len(b)):
    if b[i][1] < c[1]:
        print(b[i][0])
        break

Submission status: Wrong Answer

Solution code:
import sys
a=input()
c=a.split(" ")
c[0]=int(c[0])
c[1]=int(c[1])
b=[input().split(" ") for x in range(c[0])]

for i in range(len(b)):
    for x in range(2):
        b[i][x]=int(b[i][x])



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

print(b)

if c[1] < b[0][1]:
    print("TLE")
    sys.exit()
b.sort(key=lambda x:x[0])
for i in range(len(b)):
    if b[i][1] < c[1]:
        print(b[i][0])
        break

Submission status: Wrong Answer

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


n = n_list[0]
time = n_list[1]

x = 0
output = 'TLE'
num = 1

while num <= n:
    n_list2 = list(map(int, input().split()))
    if time - n_list2[1] > 0:
        if x - (time - n_list2[1]) < 0:
            output = n_list2[1]
            num += 1
        else:
          num += 1
    else:
      num += 1

print(output)

Submission status: Wrong Answer

Solution code:
import numpy as np
NT=list(map(int,input().split()))
N=NT[0]
T=NT[1]
nlist=[]
tlist=[]
for i in range(N):
    listA=list(map(int,input().split()))
    nlist.append(listA[0])
    tlist.append(listA[1])
#indexes = [i for i, x in enumerate(tlist) if x <= T]
npnlist=np.array(nlist)
nptlist=np.array(tlist)
where=np.where(npnlist<=T)
minmum=10000
for i in range(len(where[0])):
    if(npnlist[where[0][i]]<minmum):
        minmum=npnlist[where[0][i]]
print(minmum)

Submission status: Wrong Answer

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

for _ in range(n):
    a,b = map(int,input().split())
    if b < t:
        less.append(a)

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

Submission status: Wrong Answer

Solution code:
a=[]
b=1000
n,t=map(int,input().split(" "))
for _ in range(n):
    a.append(tuple(map(int,input().split(" "))))
for i in range(n):
    if t>=a[i][1]:
        if b>a[i][0]:
            b=a[i][0]
if b !=1000:
    print(b)
else:
    print("TLE")

Submission status: Wrong Answer

Solution code:
if __name__ == "__main__":
    N, T = map(int,input().split(' '))
    c = []
    t = []
    for i in range(N):
        c1, t1 = [int(i) for i in input().split(' ')]
        c.append(c1)
        t.append(t1)

    min = "None"
    for i in range(N):
        if T >= t[i]:
            min = c[i]
    
    if min == "None":
        print("TLE")
    else:
        print(min)
    '''
    try:
        print(min)
    except NameError:
        print("TLE")
    '''

Submission status: Wrong Answer

Solution code:
import numpy as np

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

s = np.array([])

for i in range(N):
    s = np.append(s, np.array(list(map(int, input().split()))))

s = s.reshape((N, 2))

pos = np.where(s[:, 1] <= T)

if pos[0].shape == (0,):
    print('TLE')
else:
    np.sort(s[pos], axis=0)
    print(int(s[0][0]))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

lf = list(filter(lambda x: x[1] <= T, l))

if(len(lf) == 0):
    print('TLE')
else:
    ls = sorted(lf, key=lambda x: x[0])
    print(l.index(ls[0]) + 1)

Submission status: Wrong Answer

Solution code:
N,T  = map(int,input().split())
Ans = T
for item in range(N):
    C = input().split()
    if int(C[1]) <= T:
        Ans = min(Ans,int(C[0]))
        
if Ans > T:
    print ("TLE")
else:
    print(Ans)

Submission status: Wrong Answer

Solution code:
a=input()
c=a.split(" ")
c[0]=int(c[0])
c[1]=int(c[1])
b=[input().split(" ") for x in range(c[0])]

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

if c[1] < int(b[len(b)-1][1]):
    print("TLE")
for i in range(len(b)):
    if int(b[i][1]) < c[1]:
        print(b[i][0])
        break

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
route = {}
cost = float('inf')
for i in range(N):
    u, v = map(int, input().split())
    route[v] = u
for to in route.keys():
    if to <= T:
        if route[to] < cost:
            cost = route[to]
if cost != float('inf'):
    print(cost)
else:
    print('TLE')

Submission status: Wrong Answer

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

TEL = 0
for i in range(n[0]):
    if n[1] > data[i][1]:
        TEL += 1
if TEL == 0:
    print("TLE")
elif TEL != 0:
    min = 101
    for l in range(n[0]):
        if data[l][0] < min and data[l][1] <= n[1]:
            min = data[l][0]
    print(min)

Submission status: Wrong Answer

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

ans = 10**10
ret = 0

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

if ret == 0:
    ret = "TLE"

print(ret)

Submission status: Wrong Answer

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

k=[]

for x in range(n):
  if (int(l[x][1]) <= t):
    k.append(l[x][0])
  
if (k==[]):
  print('TLE')
else:  
  print(min(k))

Submission status: Wrong Answer

Solution code:
N,T=list(map(int,input().split()))
c=[]
t=[]
for i in range(N):
    a,b=list(map(int,input().split()))
    c.append(a)
    t.append(b)
tmp=1001
for i in range(N):
    if(t[i]<=T):
        if(tmp>c[i]):
            tmp=c[i]
if(tmp==1001):    print("TLE")
else:    print(c[i])

Submission status: Wrong Answer

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

k=[]

for x in range(n):
  if (int(l[x][1])<t):
    k.append(l[x][0])
  
if (k==[]):
  print('TLE')
else:  
  print(min(k))

Submission status: Wrong Answer

Solution code:
#encoding utf-8
from operator import itemgetter


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

ct = []
for i in range(n):
    c_0,t_0 = map(int, input().split())
    ct.append([c_0,t_0])

ct0 = list(ct)
ct.sort(key=itemgetter(1))
# print(ct)
# print(ct0)
if ct[0][1] <= t:
    for i in range(len(ct0)):
        if ct[0] == ct0[i]:
            print(int(i)+1)
else:
    print("TLE")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,T = [int(i) for i in input().split()]
ans = 1000
for _ in range(n):
    c, t = [int(i) for i in input().split()]
    if ans > c and t < T:
        ans = c
print(ans)

Submission status: Wrong Answer

Solution code:
N,T  = map(int,input().split())
Ans = T + 1
for item in range(N):
    C = input().split()
    if int(C[1]) <= T:
        Ans = min(Ans,int(C[0]))
        
if Ans > T:
    print ("TLE")
else:
    print(Ans)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Oct  6 14:05:15 2018

@author: rgraptin
"""

params = input()

n = int(params.split(' ')[0])
t = int(params.split(' ')[1])

data = []

for i in range(0, n) :
    d = input()
    data.append([int(d.split(' ')[0]),int(d.split(' ')[1])])
    
minimum_cost = 1000000
    
for cost in data :
    if cost[1] <= t : 
        
        if cost[0] < minimum_cost :
            print (cost)
            minimum_cost = cost[0]

if minimum_cost == 1000000:
    print ("TLE")
else :
    print (minimum_cost)

Submission status: Wrong Answer

Solution code:

n,t = map(int,input().split())
data=[]

for i in range(n):
    data.append(list(map(int,input().split())))
    
data.sort(key=lambda x:x[1])

pos = len(data)
for i in range(len(data)):
    if data[i][1] >t:
        pos = i-1
        break
        
if pos==-1:
    print('TLE')
else:
    new = data[:pos]
    new.sort(key=lambda x:x[0])
    print(new[0][0])

Submission status: Wrong Answer

Solution code:

def qsort(a):
    if(len(a)>=1):
        pivot=a[0][1]
        lst=[]
        nlst=[]
        for i in range(1,len(a)):
            if(a[i][1]<pivot):
                lst.append(a[i])
            else:
                nlst.append(a[i])
        qsort(lst)
        qsort(nlst)
        return lst+[a[0]]+nlst
    else:
        return None

    

N,T=input().split(' ')
N=int(N)
T=int(T)
a=list()
for i in range(N):
    c,t=input().split(' ')
    c=int(c)
    t=int(t)
    a.append((c,t))
a=qsort(a)
minValue=0x7FFFF
for it in a:
    if it[1]>T:
        break
    if it[0]<minValue:
        minValue=it[0]
if(minValue==0x7FFFF):
    print("TLE")
else:
    print(minValue)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!

inp = input().split(' ')
N = int(inp[0])
T = int(inp[1])
flag = False
ans_cost = -1

for i in range(N):
    inp = input().split(' ')
    c = int(inp[0])
    t = int(inp[1])
    
    if ans_cost == -1:
        ans_cost = c
    if t > T:
        continue
    if ans_cost > c:
        flag = True
        ans_cost = c

if flag == True:
    print(ans_cost)
else:
    print('TLE')

Submission status: Wrong Answer

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

N = inputs[0]
T = inputs[1]

inputs =  list(map(int, input().split()))

best = 9999

for i in range(N-1):
    inputs = list(map(int, input().split()))
    if(T >= inputs[1]):
        if(best >= inputs[0]):
            best = inputs[0]

if best != 9999:
    print(best)
else:
    print("TLE")

Submission status: Wrong Answer

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

mi = 1000
now_mi = -1
for i in range(N):
  if t[i] <= T:
    if mi > c[i]:
      mi = c[i] 
      #now_mi = i

if mi == 1000:
  print("TLE")
else:
  print(mi)

Submission status: Wrong Answer

Solution code:
Base = input().split(" ")
N = int(Base[0])
TL = int(Base[1])
TX = 10000

for i in range(N):
    Roi = input().split(" ")
    Coi = int(Roi[0])
    TLi = int(Roi[1])
    if TL >= TLi:
        if TX >= int(Coi):
            TX = Coi
print(TX)

Submission status: Wrong Answer

Solution code:
nt = input().split(" ")
n = int(nt[0])
t = int(nt[1])

min_cost = 0

for i in range(n):
    cost_time = input().split(" ")
    cost = int(cost_time[0])
    time = int(cost_time[1])
    if time <= t:
        if min_cost == 0:
            min_cost = cost
        else:
            if min_cost > cost:
                min_cost = cost

if min_cost != 0:
    print(min_cost)

Submission status: Wrong Answer

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


def main():
    n, large_t = map(int, input().split())
    cost = 10000

    for i in range(n):
        ci, ti = map(int, input().split())

        if ti <= large_t:
            cost = min(cost, ci)

    if cost <= large_t:
        print(cost)
    elif cost == 10000:
        print('TLE')
    else:
        print('TLE')


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n,t = map(int,raw_input().split(' '))
arr=[]
for _ in range(n):
	e = map(int,raw_input().split(' '))
	e[1] = t-e[1]
	arr.append(e)
arr.sort(key = lambda x: (x[1],x[0]),reverse=True)

t = zip(*arr)

if 0 in t[1]: print t[0][t[1].index(0)]
elif t[1][0]<t and t[1][0]>0: print t[0][0]
else: print "TLE"

Submission status: Wrong Answer

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_idx = t.index(min(t))

if min(t) <= T:
    print(c[min_idx])
else:
    print('TLE')

Submission status: Wrong Answer

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

b = []
count = 0
for i in range(N):
    if a[i][1] <= T:
        b.append(a[i][0])
if count == 0:
    print('TLE')

else:
    print(min(b))

Submission status: Wrong Answer

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

N = inputs[0]
T = inputs[1]

inputs =  list(map(int, input().split()))

best = 9999

for i in range(N-1):
    inputs = list(map(int, input().split()))
    if(T >= inputs[1]):
        if(best>inputs[0]):
            best = inputs[0]

if best != 9999:
    print(best)
else:
    print("TLE")

Submission status: Wrong Answer

Solution code:
import numpy as np,math,itertools
n,t=map(int,input().split())
ct=[list(map(int,input().split())) for i in range(n)]
p=[]
for i in range(n):
    if ct[i][1]<t:
        p+=[ct[i][0]]
if p!=[]:print(min(p))
else:print("TLE")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,t=map(int,input().split())
result=t+1
for i in range(n):
    ci,ti=map(int,input().split())
    if ti > t:
        pass
    else:
        result=min(result,ci)
if result==t+1:
    print('TLE')
else:
    print(result)

Submission status: Wrong Answer

Solution code:
N,T=map(int,input().split())
x=[]
for i in range(N):
  c1=list(map(int,input().split()))
  x.append(c1)
  
x.sort()
for i in range(N):
  if x[i][1]<=T:
    print(x[i][0])
    break
  else:
    continue

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np,math,itertools
n,t=map(int,input().split())
ct=[list(map(int,input().split())) for i in range(n)]
p=10000
for i in range(n):
    if ct[i][1]<t:
        if p>ct[i][0]:
            p=ct[i][0]
print(p)

Submission status: Wrong Answer

Solution code:
n,T=map(int,input().strip().split())
arr=[]
for _ in range(n):
    c,t=map(int,input().strip().split())
    arr.append((c,t))
arr=sorted(arr,key=lambda x:x[0])
flag=True
for a,b in arr:
    if b<=T:
        print(a)
        break
    else:
        flag=False 
if flag==False:
    print('TLE')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N,T =map(int,input().split())
min_N=1000
min_T=1000
for  i in range (N):
    N_,T_ =map(int,input().split())
    if T_<=T:
        if N_<min_N:
            min_N=N_
            min_T=T_
            
if min_T>T:
    print ('TLE')
else:
    print (min_N)

Submission status: Wrong Answer

Solution code:
# Your code here!

[N,T] = map(int,input().split())
ca = 10000
ta = None
for _ in range(N):
    c, t = map(int,input().split())
    if c < ca and t < T:
        ca = c
        ta = t

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

Submission status: Wrong Answer

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

way = []

for i in range(N):
  c,t = map(int, input().split(" "))
  if T >= t:
    way.append([c])
  
if len(way) == 0:
  print("TLE")
else:
  way.sort()
  print(way[0])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#coding:utf-8
min_t = 10000
n,T = list(map(int,input().split()))
for i in range(n):
    c,t = list(map(int,input().split()))
    if t < min_t:
        min_t = t
        min_c = c
if min_t<=T:
    print (c)
else:
    print ('TLE')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
li = list(map(int, input().split()))
N = li[0]
L = li[1]
m = li[1]
idx=0
for i in range(N):
    li = list(map(int, input().split()))
    if li[1] < m:
        m=li[1]
        idx=li[0]

if m != L:
    print(idx)
else:
    print('TLE')

Submission status: Wrong Answer

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

mc = float("inf")
ans = "TLE"

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

print(ans)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import math,string,itertools,fractions,heapq,collections,re,array,bisect

N,TT = map(int,input().split())
C,T = [],[]
for i in range(N):
    c,t = map(int,input().split())
    C.append(c)
    T.append(t)
ans = max(C)+1

for i in range(N):
    t,c = T[i],C[i]
    if t <= TT:
        if ans > c:
            ans = c
print(ans)

Submission status: Wrong Answer

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


def main():
    n, large_t = map(int, input().split())
    cost = 1001

    for i in range(n):
        ci, ti = map(int, input().split())

        if ti <= large_t:
            cost = min(cost, ci)

    if cost <= large_t:
        print(cost)
    else:
        print('TLE')


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,T=list(map(int,input().split()))
min_=1111
for i in range(N):
    c,t=list(map(int,input().split()))
    if t <=T:
        if min_>c:
            min_=c
print(min_)

Submission status: Wrong Answer

Solution code:
n, T = list(map(int, input().split()))
ans = 10000
for i in range(n):
    c, t = list(map(int, input().split()))
    if t > T:
        continue
    else:
        ans = min(ans, c)
print(ans)

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
ct = [list(map(int, input().split())) for i in range(N)]
ans = 10000000
for i in ct:
    if i[1] <= T:
        ans = min(i[0], ans)

print(ans)

Submission status: Wrong Answer

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from typing import List


def answer(n: int, t: int, cts: List[List[int]]) -> int:
    costs = [route[0] for route in cts if route[1] <= t]
    if not costs:
        return -1

    return min(costs)


def main():
    n, t = map(int, input().split())
    cts = [list(map(int, input().split())) for _ in range(n)]
    ans = answer(n, t, cts)
    print(ans if ans != -1 else 'TLE')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
ma = lambda :map(int,input().split())
lma = lambda :list(map(int,input().split()))
tma = lambda :tuple(map(int,input().split()))
ni = lambda:int(input())
yn = lambda fl:print("Yes") if fl else print("No")
import collections
import math
import itertools
import heapq as hq
import sys
n,T = ma()
ans=10**15
for i in range(n):
    c,t=ma()
    if t<=T:
        ans=min(ans,c)
if ans==10**15:
    print("TLE")
else:print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,t=map(int, input().split())
c_list,t_list=[],[]
for i in range(n):
  x,y=map(int, input().split())
  c_list.append(x)
  t_list.append(y)
cost=1001
for i in range(n):
  if t_list[i]<=t and c_list[i]<cost:
    cost=c_list[i]
print(cost if cost<1001 else "TLE")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

print(cost)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
def mapt(fn, *args):
    return tuple(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))
  

def main():
    n, t = Input()
    data = [Input() for _ in range(n)]
    ans = 1001

    for cost, time in data:
        if time <= t:
            ans = min(ans, cost)

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


main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    # n = int(input())
    n, t = map(int, input().split())
    # a = list(map(int, input().split()))
    # s = input()
    ct = []
    for _ in range(n):
        ct.append(list(map(int, input().split())))

    mini = 10**10
    for i in range(n):
        if ct[i][1] <= t and ct[i][0] < mini:
            mini = ct[i][0]

    if mini == 10**10:
        print("TLE")
    else:
        print(mini)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n,T =map(int,input().split())
ans = 10**3+1
for i in range(n):
    c,t=map(int,input().split())
    if t > T:
        continue
    else:
        ans = min(ans,c)
if ans == 10**3+1:
    print('TLE')
else:
    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)
        
print('TLE' if ans == 1001 else ans)

Submission status: Accepted

Solution code:
n, t = map(int, input().split())
a = [list(map(int, input().split())) for i in range(n)]
l = []
flag = False
for i in range(n):
    if a[i][1] <= t:
        l.append(a[i][0])
        flag = True
if flag:
    print(min(l))
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)
if ans==10000:
    print("TLE")
else:
    print(ans)