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

c_min = 1000
for c_i, t_i in zip(c, t):
    if t_i <= T and c_i < c_min:
        c_min = c_i

if c_min == 1000:
    print('TLE')
    exit()

else:
    print(c_min)

Submission status: Wrong Answer

Solution code:
n,t = map(int,raw_input().split())
arr = []
for i in range(n):
    a,b = map(int,raw_input().split())
    arr.append((a,b))
cs = 10**20
for i in range(n):
    if arr[i][1] <= t:
        cs = min(cs,arr[i][0])
print cs

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
dic = {}
for i in range(N):
    c, t = map(int, input().split())
    dic[t] = c
if max(dic) <= T:
    print(dic[max(dic)])
else:
    print('TLE')

Submission status: Wrong Answer

Solution code:
NT = list(map(int, input().split()))
mini = -1
for i in range(NT[0]):
    route = list(map(int, input().split()))
    if route[1] < NT[1]:
        if mini == -1:
            mini = route[0]
        elif mini > route[0]:
            mini = route[0]
if mini == -1:
    print("TLE")
else:
    print(mini)

Submission status: Wrong Answer

Solution code:
NT = list(map(int, input().split()))
mini = -1
for i in range(NT[0]):
    route = list(map(int, input().split()))
    if route[1] < NT[1]:
        if mini == -1:
            mini = route[0]
        elif mini > route[0]:
            mini = route[0]

print(mini)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(min_cost if min_cost < 1000 else "TLE")

Submission status: Wrong Answer

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

l=sorted(l,key=lambda x:x[0],reverse=True)
for i in l:
    if i[1]<t:
        print(i[0])
        break
print('TLE')

Submission status: Wrong Answer

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

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

MAX = 2^10
ans = MAX

for i in range(n):
  if lst[i][1] <= t:
    ans = min(ans, lst[i][0])
if ans < MAX:
  print(ans)
else:
  print("TLE")

Submission status: Wrong Answer

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

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

MAX = 2^10
ans = MAX

for i in range(n):
  if lst[i][1] <= t:
    ans = min(MAX, lst[i][0])
if ans == MAX:
  print("TLE")
else:
  print(ans)

Submission status: Wrong Answer

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

minimize = 10000
for i in range(N):
    c_i, t_i = map(int, input().split())
    if t_i < T and c_i < minimize:
        minimize = c_i

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n,t=map(int,input().split())
cx=1000
f=True
for i in range(n):
	ci,ti=map(int,input().split())
	if ti<=t and cx>ci:
		cx=ci
		f=False
if f:
	print('TLE')
	exit()
print(cx)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n,t = list(map(int,input().split()))
a = [input() for i in range(n)]
cost = 1000
x = 0

for i in range(n):
  b = list(map(int,a[i].split()))
  if t >= b[1] and cost >= b[0]: 
    cost = b[0]
    
if cost == 1000:
  print("TLE")
else:
  print(cost)

Submission status: Wrong Answer

Solution code:
if __name__ == "__main__":
    N, T  = map(int, input().split())
    minCost = float("inf")
    answer = None
    for i in range(1,N+1):
        c,t = map(int, input().split())
        if c < minCost and t <= T:
            minCost = c
            answer = i
    if answer: 
        print(i)
    else:
        print("TLE")

Submission status: Wrong Answer

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



if __name__ == "__main__":
    N, T  = map(int, input().split())
    minCost = float("inf")
    answer = None
    for i in range(1,N+1):
        c,t = map(int, input().split())
        if c < minCost and t <= T:
            minCost = c
            answer = i
    if answer: 
        print(i)
    else:
        print("TLE")

Submission status: Wrong Answer

Solution code:

if __name__ == "__main__":
    N, T  = map(int, input().split())
    minCost = float("inf")
    answer = None
    for i in range(1,N+1):
        c,t = map(int, input().split())
        if c < minCost and t <= T:
            minCost = c
            answer = i
    if answer: 
        print(i)
    else:
        print("TLE")

Submission status: Wrong Answer

Solution code:
num_time_list = (input()).split()
num = int(num_time_list[0])
time = int(num_time_list[1])

option_list = []
for i in range(num):
    option_list.append((input()).split())
    
answer = 0
for i in range(num):
    option_cost = int(option_list[i][0])
    option_time = int(option_list[i][1])
    if option_time <= time:
        if answer > option_cost or answer == 0:
            answer = option_cost
            
            
print( answer )

Submission status: Wrong Answer

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 not l:
    print("TLE")
else:
    print(min(l))

Submission status: Wrong Answer

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

least = 10000

for _ in range(n):
	thisTime, thisCost = map(int, input().split())
	
	if thisTime <= t:
		least = min(least, thisCost)
print(least)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

C_MAX = 1000

if __name__ == "__main__":
    N, T = map(int, input().split())

    input_list = []
    for n in range(N):
        c, t = map(int, input().split())
        input_list.append((c, t))

    min_cost = C_MAX

    for c, t in input_list:
        if t <= T and c < min_cost:
            min_cost = c

    if min_cost == C_MAX:
        print("TLE")
    else:
        print(min_cost)

Submission status: Wrong Answer

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

cost_val = 'TLE'
min_time = 10000000

for i in range(N):
  cost, time = map(int, input().split())
  if time < T and time < min_time:
    cost_val, min_time = cost, time
    
print(cost_val)

Submission status: Wrong Answer

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

for i in range(N):
    a,b = map(int,input().split())
    if b <= T:
        back.append(b)

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

Submission status: Wrong Answer

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

for i in range(N):
    a,b = map(int,input().split())
    if b >= T:
        back.append(a)

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

Submission status: Wrong Answer

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

for i in range(N):
    a,b = map(int,input().split())
    if b >= T:
        back.append(b)

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

Submission status: Wrong Answer

Solution code:
N,T = (input().split())
N = int(N)
T = int(T)
roads = []
for i in range(N) :
    c , t = input().split()
    t = int(t)
    if t in range (1, T + 1):
        roads.append((int(c) ,t))

if len(roads) == 0 :
    print ("LTE")
else:
    roads.sort()
    print (roads[0][0])

Submission status: Wrong Answer

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

x=[]

for i in range(n):
    c,t=map(int, input().split())
    if t<=T:
        x.append((i+1,c))
        
x.sort(key=lambda tup: tup[1])
if len(x)!=0:
    print(x[0][0])
else:
    print('TLE')

Submission status: Wrong Answer

Solution code:
def a():
    n=list(map(int, input().split()))
    c=list()
    t = list()
    for i in range(n[0]):
        s = list(map(int, input().split()))
        c.append(s[0])
        t.append(s[1])
    z=list()
    z[len(z):]=t[:len(t)]
    z.sort()
    if z[0]>n[1]:
        print("TLE")
    else:
        x = list()
        x[len(x):] = c[:len(c)]
        x.sort()
        for i in x:
            if t[c.index(i)]<=n[1]:
                print(i)
                break
a()

Submission status: Wrong Answer

Solution code:
def a():
    n=list(map(int, input().split()))
    c=list()
    t = list()
    for i in range(n[0]):
        s = list(map(int, input().split()))
        c.append(s[0])
        t.append(s[1])
    z=list()
    z[len(z):]=t[:len(t)]
    z.sort()
    if z[0]>n[1]:
        print("TLE")
    else:
        x = list()
        x[len(x):] = c[:len(c)]
        x.sort()
        for i in x:
            print('i=',i,' c.index(i)=',c.index(i),' t[c.index(i)]=',t[c.index(i)])
            if t[c.index(i)]<=n[1]:
                print(i)
                break
a()

Submission status: Wrong Answer

Solution code:
N,T=input().split()
a=0
b=0
i=0
for i in range (int(N)):
    c,t=input().split()
    if int(t)<=int(T) :
        while b == 0:
            a = c
            b += 1
        if int (c)< int (a):
            a=c
            i+=1
if i == 0 or a==0 :
    print ("TLE")
else :
    print (a)

Submission status: Wrong Answer

Solution code:
N,T=input().split()
a=0
b=0
i=0
for i in range(int(N)):
    c,t=input().split()
    if int(t)<=int(T):
        if b==0:
            a=c
            b+=1
        if int(c)<int (a):
            a=c
            i+=1
if i==0 or a==0:
    print("TLE")
else :
    print(a)

Submission status: Wrong Answer

Solution code:
N,T=input().split()
a=0
b=0
i=0
for i in range (int(N)):
    c,t=input().split()
    if int(t)<=int(T) :
        while b == 0:
            a=c
            b+=1
        if int (c)< int (a):
            a=c
            i+=1
if i == 0 or a==0 :
    print ("TLE")
else :
    print (a)

Submission status: Wrong Answer

Solution code:
P,D=input().split()
c=0
for i in range (int(D)):
    dp,b=input().split()
    if int(P)<int(dp) :
        break
    else :
        P=int(P)+int(b)
        c+=1
if c==int(D) :
    print ("YES")
else :
    print ("NO")

Submission status: Wrong Answer

Solution code:
N,T=input().split()
x=0
b=0
i=0
for i in range (int(N)):
    c,t=input().split()
    if int(t)<=int(T) :
        while b == 0:
            x = c
            b += 1
        if int (c)< int (x):
            x=c
            i+=1
if i == 0 or x==0 :
    print ("TLE")
else :
    print (x)

Submission status: Wrong Answer

Solution code:
N , T = map(int, input().split())
mini = 999
x = []
y = []
for i in range(N):
    c , t =map(int, input().split())
    x = x + [[c,t]]
for j in range(N):
    if int(x[j][0])<mini:
        mini = int(x[j][0])
if int(x[j][1])<T:
    print(x[j][0])
else:
    print("TLE")

Submission status: Wrong Answer

Solution code:
N , T = map(int, input().split())
mini = 1000
x = []
y = []
for i in range(N):
    c , t =map(int, input().split())
    x = x + [[c,t]]
for j in range(N):
    if int(x[j][0])<mini:
        mini = int(x[j][0])
if int(x[j][1])<T:
    print(x[j][0])
else:
    print("TLE")

Submission status: Wrong Answer

Solution code:
N , T = map(int, input().split())
mini = 1000
x = []
y = []
for i in range(N):
    c , t =map(int, input().split())
    x = x + [[c,t]]
for j in range(N):
    if int(x[j][1])<mini:
        mini = int(x[j][1])
if mini<T:
    print(x[j][0])
else:
    print("TLE")

Submission status: Wrong Answer

Solution code:
def LimitedTime(Array , T , N):
    MinC=1000
    for i in range (N):
            if Array[i][1]<=T:
               if Array[i][0]<MinC:
                   MinC=Array[i][0]
    if MinC==1000:
        return 'TLE'
                
    return MinC            
                   
                   



TandN=list(map(int ,input().split()))
N=TandN[0]
T=TandN[1]
Array=[[int(j) for j in input().split()]for i in range(N)]
print(LimitedTime(Array , T ,N))

Submission status: Wrong Answer

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

for i in range (0,N):
    c_,t_= map(int, input().split())
    if(t_<=T):#コストが高いものを除外
        c.append(c_)
        t.append(t_)
print(N,T)
print(c,t)

if( len(t)==0 ):#一つも低コストがない
    print("TLE")
else:
    print(min(c))

Submission status: Wrong Answer

Solution code:
N , T  = map(int,input().split())
result = 1001
while N >0:
 a,b = map(int,input().split())
 if b < T and a < result:
  result = a
 N = N - 1
if result == 1001:
 print('TLE')
else:
 print(result)

Submission status: Wrong Answer

Solution code:
N , T  = map(int,input().split())
tmp_a = 1001
result = 1001
count = 1
while count < N+1:
 a,b = map(int,input().split())
 if b < T and a < tmp_a:
  result = count
  tmp_a = a
 count = count + 1
if result == 1001:
 print('TLE')
else:
 print(result)

Submission status: Wrong Answer

Solution code:
N , T  = map(int,input().split())
tmp_a = 1000
result = 0
count = 1
while count < N+1:
 a,b = map(int,input().split())
 if b < T and a < tmp_a:
  result = count
  tmp_a = a
 count = count + 1
if result == 0:
 print('TLE')
else:
 print(result)

Submission status: Wrong Answer

Solution code:
N , T  = map(int,input().split())
tmp_a = 1000
result = 0
count = 1
while count < N+1:
 a,b = map(int,input().split())
 if b <= T and a < tmp_a:
  result = count
  tmp_a = a
 count = count + 1
if result == 0:
 print('TLE')
else:
 print(result)

Submission status: Wrong Answer

Solution code:
N , T  = map(int,input().split())
tmp_a = 1000
result = 0
count = 0
while count < N:
 a,b = map(int,input().split())
 if b < T and a < tmp_a:
  result = N
  tmp_a = a
 count = count + 1
if result == 0:
 print('TLE')
else:
 print(result)

Submission status: Wrong Answer

Solution code:
N , T  = map(int,input().split())
tmp_a = 1000
result = 0
while N > 0:
 a,b = map(int,input().split())
 if b < T & a < tmp_a:
  result = N
  tmp_a = a
 N = N -1
if result == 0:
 print('TLE')
else:
 print(result)

Submission status: Wrong Answer

Solution code:
d = list(map(int,(input().strip().split(' '))))
N = d[0]
T = d[1]
min = 100000000
for i in range(0, N-1):
    d = list(map(int,input().strip().split(' ')))
    c = d[0]
    t = d[1]
    if t <= T:
        if min >= c:
            min = c
if min == 100000000:
    print("TLE")
else:
    print(min)

Submission status: Wrong Answer

Solution code:
d = list(map(int,(input().strip().split(' '))))
N = d[0]
T = d[1]
min = 10000
for i in range(0, N-1):
    d = list(map(int,input().strip().split(' ')))
    c = d[0]
    t = d[1]
    if t <= T:
        if min > c:
            min = c
if min == 10000:
    print("TLE")
else:
    print(min)

Submission status: Wrong Answer

Solution code:
d = list(map(int,(input().strip().split(' '))))
N = d[0]
T = d[1]
min = 10000
for i in range(0, N-1):
    d = list(map(int,input().strip().split(' ')))
    c = d[0]
    t = d[1]
    if t < T:
        if min >= c:
            min = c
if min == 10000:
    print("TLE")
else:
    print(min)

Submission status: Wrong Answer

Solution code:
d = list(map(int,(input().strip().split(' '))))
N = d[0]
T = d[1]
min = 10000
for i in range(0, N-1):
    d = list(map(int,input().strip().split(' ')))
    c = d[0]
    t = d[1]
    if t <= T:
        if min >= c:
            min = c
if min == 10000:
    print("TLE")
else:
    print(min)

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
i = 0
min_cost = 1000
fg = False
while i < N:
    i += 1
    c, t = map(int, input().split())
    if t <= T:
        if c <= min_cost:
            fg = True
            min_cost = c

if min_cost != 1000 and fg:
    print(min_cost)
else:
    print('TLE')

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
i = 0
min_cost = 2147483647
while i < N:
    i += 1
    c, t = map(int, input().split())
    if t < T:
        if c < min_cost:
            min_cost = c

if min_cost != 2147483647:
    print(min_cost)
else:
    print('TLE')

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
l = map(int, raw_input().split())
n = l[0]
t = l[1]

"""
x = []
for i in range(n):
  x.append(map(int, raw_input().split()))
print(x)
"""

lst = [map(int, raw_input().split()) for i in range(n)]
#print(lst)

"""
minc = x[0]
mint = t

for j in range(n):
  if x[j][1] <= mint:
    mint = x[j][1]
    minc = x[j][0]
    #print("mint updated")
  else:
    continue

if mint < t:
  print(minc)
else:
  print("TLE")
"""

#sort_using lambda
lst = sorted(lst, key = lambda x:x[1])
#print(lst)

maxt = t
minc = 9999

for j in range(n):
  if lst[j][1] <= maxt and lst[j][0] <= minc:
    minc = lst[j][0]
  else:
    break

"""
if maxt <= t:
  print(minc)
else:
  print("TLE")
"""

if minc == 9999:
  print("TLE")
else:
  print(minc)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
l = map(int, raw_input().split())
n = l[0]
t = l[1]

"""
x = []
for i in range(n):
  x.append(map(int, raw_input().split()))
print(x)
"""

lst = [map(int, raw_input().split()) for i in range(n)]
#print(lst)

"""
minc = x[0]
mint = t

for j in range(n):
  if x[j][1] <= mint:
    mint = x[j][1]
    minc = x[j][0]
    #print("mint updated")
  else:
    continue

if mint < t:
  print(minc)
else:
  print("TLE")
"""

#sort_using lambda
lst = sorted(lst, key = lambda x:x[1])
#print(lst)

maxt = t
minc = 9999

for j in range(n):
  if lst[j][1] <= maxt and lst[j][0] < minc:
    minc = lst[j][0]
  else:
    break

"""
if maxt <= t:
  print(minc)
else:
  print("TLE")
"""

if minc == 9999:
  print("TLE")
else:
  print(minc)

Submission status: Wrong Answer

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

c = 1001
for i in range(n):
    if e[i][1] < t:
        c = min(c, e[i][0])
if c <= 1000:
    print(str(c))
else:
    print('TLE')

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
l = map(int, raw_input().split())
n = l[0]
t = l[1]

"""
x = []
for i in range(n):
  x.append(map(int, raw_input().split()))
print(x)
"""

lst = [map(int, raw_input().split()) for i in range(n)]
#print(lst)

"""
minc = x[0]
mint = t

for j in range(n):
  if x[j][1] <= mint:
    mint = x[j][1]
    minc = x[j][0]
    #print("mint updated")
  else:
    continue

if mint < t:
  print(minc)
else:
  print("TLE")
"""

#sort_using lambda
lst = sorted(lst, key = lambda x:x[1])
#print(lst)

maxt = t
minc = "TLE"

for j in range(n):
  if lst[j][1] <= maxt and lst[j][0] < minc:
    minc = lst[j][0]
  else:
    break

#
if maxt <= t:
  print(minc)
else:
  print("TLE")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
l = map(int, raw_input().split())
n = l[0]
t = l[1]

"""
x = []
for i in range(n):
  x.append(map(int, raw_input().split()))
print(x)
"""

lst = [map(int, raw_input().split()) for i in range(n)]
#print(lst)

"""
minc = x[0]
mint = t

for j in range(n):
  if x[j][1] <= mint:
    mint = x[j][1]
    minc = x[j][0]
    #print("mint updated")
  else:
    continue

if mint < t:
  print(minc)
else:
  print("TLE")
"""

#sort_using lambda
lst = sorted(lst, key = lambda x:x[1])
#print(lst)

#最初からTLEで入れておく
maxt = t
minc = "TLE"

for j in range(n):
  if lst[j][1] <= maxt:
    minc = lst[j][0]
  else:
    break

if maxt <= t:
  print(minc)
else:
  print("TLE")

Submission status: Wrong Answer

Solution code:
minC = 1000
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 == 0):
    print("TLE")
else:
    print(minC)

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

min = 1000

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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 = None
for i in range(N):
    if t[i] <= T and (min_cost is None or c[i] <= min_cost):
        min_cost = c[i]
        result = i

if min_cost is None:
    print("TLE")
else:
    print(i+1)

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

Solution code:
i = 1
min = 100000
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 == 100000:
    print("TLE")
    exit()
else:
    print(min)
    exit()

Submission status: Wrong Answer

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:
    x = min(x, ans)
print(ans if ans < 1e6 else '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 and c <= ans:
    ans = c
  if ans == 1001:
    print("TLE")
  else:
    print(ans)

Submission status: Wrong Answer

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

Solution code:
N = int()
T = int()
ans = 1001

for i in range(N):
  c = int()
  t = int()
  if t <= T:
    ans = min(ans,c)
   
  if ans == 1001:
    print("TLE")
   
  else:
    print(ans)

Submission status: Wrong Answer

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>T:
    print('TLE')
else:
    print(a)

Submission status: Wrong Answer

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)
        
if a>T:
    print('TLE')
else:
    print(a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,T =map(int,input().split())
ans = 1000
for i in range(0,N):
    c,t=map(int,input().split())
    if t <=T:
        ans =min(ans,c)
    i +=1
print(ans)

Submission status: Wrong Answer

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

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:
        comp_cost = c
        if comp_cost < min_cost:
            min_cost = comp_cost
            cnt += 1

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
if N < 1 or N > 100:
    exit()
if T < 1 or T > 1000:
    exit()

jugde = False
jugde_N = 100
maplist = {}
for i in range(N):
    ci,ti = map(int, input().split())
    if ci < 1 or ci > 1000:
        exit()
    if ti < 1 or ti > 1000:
        exit()
    if maplist.get(ci) == None:
        maplist[ci] = ti
    else:
        exit()
for jN,jT in maplist.items():
    if jT <= T:
        if jN <= jugde_N:
            jugde = True
            jugde_N = jN
if jugde == False:
    print('TLE')
else:
    print(jugde_N)

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
if N < 1 or N > 100:
    exit()
if T < 1 or T > 1000:
    exit()

jugde = False
jugde_N = 100
for i in range(N):
    ci,ti = map(int, input().split())
    if ci < 1 or ci > 1000:
        exit()
    if ti < 1 or ti > 1000:
        exit()
    if ti <= T:
        if jugde_N > ci:
            jugde = True
            jugde_N = ci
if jugde == False:
    print('TLE')
else:
    print(jugde_N)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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 = ti
if cost > 1000:
    print('TLE')
    exit()
print(cost)

Submission status: Wrong Answer

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 > ti:
        cost = ti
if cost > 1000:
    print('TLE')
    exit()
print(cost)

Submission status: Wrong Answer

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')
print(cost)

Submission status: Wrong Answer

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')
print(cost)

Submission status: Wrong Answer

Solution code:
total = [int(i) for i in input().split()]
n = total[0]
time_limit = total[1]

ci = []
ti = []
for i in range(n):
    list = [int(j) for j in input().split()]
    ci.append(list[0])
    ti.append(list[1])

min = 1000
for i in range(len(ci)):
    if ci[i] < min and ti[i] < time_limit:
        min = ci[i]

if min != 1000:
    print(min)
else:
    print("TLE")

Submission status: Wrong Answer

Solution code:
total = [int(i) for i in input().split()]
n = total[0]
time_limit = total[1]

ci = []
ti = []
for i in range(n):
    list = [int(j) for j in input().split()]
    ci.append(list[0])
    ti.append(list[1])

min = 1000
for i in range(len(ci)):
    if ci[i] <= min and ti[i] <= time_limit:
        min = ci[i]
        update = 1

if min != 1000:
    print(min)
else:
    print("TLE")

Submission status: Wrong Answer

Solution code:
total = [int(i) for i in input().split()]
n = total[0]
time_limit = total[1]

ci = []
ti = []
for i in range(n):
    list = [int(j) for j in input().split()]
    ci.append(list[0])
    ti.append(list[1])

min = ci[0]
update = 0
for i in range(1, len(ci)):
    if ci[i] <= min and ti[i] <= time_limit:
        min = ci[i]
        update = 1

if update == 1:
    print(min)
else:
    print("TLE")

Submission status: Wrong Answer

Solution code:
total = [int(i) for i in input().split()]
n = total[0]
time_limit = total[1]

ci = []
ti = []
for i in range(n):
    list = [int(j) for j in input().split()]
    ci.append(list[0])
    ti.append(list[1])

min = ci[0]
update = 0
for i in range(1, len(ci)):
    if ci[i] < min and ti[i] <= time_limit:
        min = ci[i]
        update = 1

if update == 1:
    print(min)
else:
    print("TLE")

Submission status: Wrong Answer

Solution code:
total = [int(i) for i in input().split()] # 経路数と時間の上限を受け取る
n = total[0]
time_limit = total[1]

# print("{0} {1}".format(n, time_limit))

ci = []
ti = []
for i in range(n):
    list = [int(j) for j in input().split()]
    ci.append(list[0])
    ti.append(list[1])

min = ci[0]
update = 0
for i in range(1, len(ci)):
    if ci[i] < min and ti[i] <= time_limit:
        min = ci[i]
        update = 1

if update == 1:
    print(min)
else:
    print("TLE")