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:
a, b = map(int, input().split())
e = []
for i in range(a):
    c, d = map(int, input().split())
    if b>=d:
        e.append(c)
print(min(e) if not e == [] else "ELT")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 1000

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

Submission status: Wrong Answer

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

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

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

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

print(minc)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
k = [[int(i) for i in input().split()] for _ in range(N)]
ans = float('inf')
for c, t in k:
    if t <= T:
        ans = min(ans, c)
print(ans if ans <= T else 'TLE')

Submission status: Wrong Answer

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

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

B = []
for i in A:
    if i[1] < t:
        B.append(i)

if len(B):
    B.sort(key=lambda x: x[0])
    print(B[0][0])
else:
    print("TLE")

Submission status: Wrong Answer

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

for i in range(N):
  a,b=map(int,input().split())
  if mini==-1 and b<=T:
    mini=a
  elif b<=T and mini>a:
    mini=a
if mini==-1: print("TEL")
else: print(mini)

Submission status: Wrong Answer

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

c=[]
t=[]
c=0
mini=-1
for i in range(N):
  a,b=map(int,input().split())
  if mini==-1 and b<=T:
    mini=a
  elif b<=T and mini>a:
    mini=a
if mini==-1: print("TEL")
else: print(mini)

Submission status: Wrong Answer

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

c=[]
t=[]
c=0
mini=-1
for i in range(N):
  a,b=map(int,input().split())
  if mini==-1 and b<=T:
    mini=T
  elif b<=T and mini>a:
    mini=T
    c=a
print(c)

Submission status: Wrong Answer

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

c=[]
t=[]
c=0
mini=-1
for i in range(N):
  a,b=map(int,input().split())
  if mini==-1 and b<=T:
    mini=T
  if b<=T and mini>a:
    mini=T
    c=a
print(c)

Submission status: Wrong Answer

Solution code:
N, T = [int(num) for num in input().split()]
d = {}
for _ in range(N):
    c, t = [int(num) for num in input().split()]
    d[c] = t

c = None
for cost, minutes in d.items():
    if minutes <= T:
        if c == None:
            c = cost
            continue
        if c > cost:
            c = cost

if c == T:
    print('TLE')
else:
    print(c)

Submission status: Wrong Answer

Solution code:
N, T = [int(num) for num in input().split()]
d = {}
for _ in range(N):
    c, t = [int(num) for num in input().split()]
    d[c] = t

c = T
for cost, minutes in d.items():
    if minutes <= T:
        if c > cost:
            c = cost

if c == T:
    print('TLE')
else:
    print(c)

Submission status: Wrong Answer

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

dic = {}
for val in range(n):
    c,ti = map(int,input().split())
    if ti <= t:
        dic[c] = ti

if dic == {}:
    print("TLE")
    exit()

# sort
dic = sorted(dic.items() ,key=lambda x:x[1])
print(dic[0][0])

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
c = []
t = []
for _ in range(N):
  cost, time = map(int, input().split())
  c.append(cost)
  t.append(time)

if min(t) <= T:
  if max(t) <= T:
    print(min(c))
  else:
    C = sorted(c)
    i = 0
    while i < N:
      if t[c.index(C[i])] > T:
        i += 1
      else:
        break
    print(C[i])
else:
  print("TLE")

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
c = []
t = []
for _ in range(N):
  cost, time = map(int, input().split())
  c.append(cost)
  t.append(time)

if min(t) <= T:
  if max(t) <= T:
    print(min(c))
  else:
    C = sorted(c)
    i = 0
    while i < 4:
      if t[c.index(C[i])] > T:
        i += 1
      else:
        break
    print(C[i])
else:
  print("TLE")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,t=map(int,input().split())
cost,time=zip(*list(map(int,input().split()) for i in range(n)))
ans='TLE'
c=list(cost)
ti=list(time)
for i in range(n):
    sc=min(c)
    if ti[c.index(sc)]<=t:
        ans=sc
        break
    else:
        c.pop(c.index(sc))



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:
    L = [c,t]
    C.append(L)
    
C = sorted(C,key = lambda x:x[1])

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

Submission status: Wrong Answer

Solution code:
import sys
def input():
    return sys.stdin.readline()[:-1]
n,t=map(int,input().split())
ct=[list(map(int,input().split())) for i in range(n)]
ans=float('inf')
for i in range(n):
    if ct[i][1]<=t:
        ans=min(ans,ct[i][0])
print(ans)

Submission status: Wrong Answer

Solution code:
N,K=[int(s) for s in input().split()]
n=10000
for i in range(N):
  a,b=[int(s) for s in input().split()]
  if b<=K:
    n=min([n,a])
if n==10000:
  print("TLE")
else:
  print(a)

Submission status: Wrong Answer

Solution code:
N,K=[int(s) for s in input().split()]
n=10000
for i in range(N):
  a,b=[int(s) for s in input().split()]
  if b<K:
    n=min([n,a])
if n==10000:
  print("TLE")
else:
  print(a)

Submission status: Wrong Answer

Solution code:
N,K=[int(s) for s in input().split()]
m=10000
n=10000
for i in range(N):
  a,b=[int(s) for s in input().split()]
  if b<K:
    n=min([n,a])
if m==10000:
  print("TLE")
else:
  print(a)

Submission status: Wrong Answer

Solution code:
N,T = map(int,input().split())
mat = [list(map(int,input().split())) for i in range(N)]
for i in range(N):
    if mat[i][1] > T:
        mat[i][0] = 1001
if min([x[0] for x in mat]) > T:
    print("TLE")
else:
    print(min([x[0] for x in mat]))

Submission status: Wrong Answer

Solution code:
N,T = map(int,input().split())
mat = [list(map(int,input().split())) for i in range(N)]
ans = "TLE"
for i in range(N):
    if mat[i][1] > T:
        mat[i][0] = 1001
print(min([x[0] for x in mat]))

Submission status: Wrong Answer

Solution code:
def main(n, t, c_t):
    cost = 1000

    for c, _t in c_t:
        if t >= _t:
            if c < cost:
                cost = c

    if cost == 1000:
        print('TLE')
        return

    print(cost)


if __name__ == "__main__":
    n, t = map(int, input().split(' '))
    c_t = list()
    for _ in range(n):
        c_t.append(map(int, input().split(' ')))

    main(n, t, c_t)

Submission status: Wrong Answer

Solution code:
import sys
N,T = map(int,input().split())
c = []
t = []
cmin = T
for i in range(N):
    c1,t1=[int(i) for i in input().split()]
    c.append(c1)
    t.append(t1)
if min(t) > T:
  print("TLE")
  sys.exit()    
for i in range (0,N):
  if t[i] <= T:
    cmin = min(c[i],cmin)
print(cmin)

Submission status: Wrong Answer

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

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

# print(Array)

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

# print(Array)
# print(Array[0][0])

# Array.sort(key=lambda x:x[1])
#
# print(Array)

for i in range(N):
    if Array[i][1] < T:
        print(Array[i][0])
        break
else:
  print('TLE')

Submission status: Wrong Answer

Solution code:
N, T = [int(a) for a in input().split()]
ret = T
for i in range(N):
    c, t = [int(a) for a in input().split()]
    if (t <= T):
        ret = min(ret, c)
print (ret if (ret != T) else 'TLE')

Submission status: Wrong Answer

Solution code:
n,T=map(int,input().split())
ansc=1000
for _ in range(n):
    c,t=map(int,input().split())
    if T>=t:
        ansc=min(c,ansc)
print(ansc)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
    N,T = map(int, input().split())
    min_c = 1001
    for i in range(N):
        cn,tn = map(int, input().split())
        if(tn<=T and cn < min_c):
            min_c = cn
    print(min_c)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
N,T = map(int,input().split())
c = []
t = []
c1,t1 = [int(i) for i in input().split()]
for i in range(N):
  c.append(c1)
  t.append(t1)
ans = 10000
for i in range(N):
  if t[i] <= T:
    ans = min(ans,c[i])
if ans == 10000:
  print('TLE')
else:
  print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n, t = map(int, input().split())
c = [input().split() for _ in range(n)]
c_sorted = sorted(c, key=lambda i:i[1])
print(c_sorted[0][0] if int(c_sorted[0][1]) <= t else 'TLE')

Submission status: Wrong Answer

Solution code:
N,T = list(map(int,input().split()))
C = [list(map(int,input().split())) for i in range(N)]
C = sorted(C, key = lambda x : x[1],reverse =False)

A =[0]
for i in C:
    if i[1] < T:
        A.append(i[0])

print(min(A) if min(A) != 0 else "TLE")

Submission status: Wrong Answer

Solution code:
n, time = [int(_) for _ in input().split()]
tmp = 1000
output = 0

for i in range(n):
    c, t = [int(_) for _ in input().split()]
    if c < tmp and t <= time:
        tmp = c
        output = c

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

else:
    print(output)

Submission status: Wrong Answer

Solution code:
n, time = [int(_) for _ in input().split()]
tmp = 1000
output = 0

for i in range(n):
    c, t = [int(_) for _ in input().split()]
    if c < tmp and t < time:
        tmp = c
        output = c

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

else:
    print(output)

Submission status: Wrong Answer

Solution code:
N,T = map(int,input().split())
cmin = 10**4
for _ in range(N):
    c,t = map(int,input().split())
    if t<=T:
        cmin = min(cmin,c)
print(cmin)

Submission status: Wrong Answer

Solution code:
s=list(input().split())
n=int(s[0])
l=int(s[1])
cost=[]
time=[]

for i in range(n):
  li=list(input().split())
  if int(li[1])<l:
    cost.append(int(li[0]))
    time.append(int(li[1]))
if len(cost)==0:
  print('TLE')
else:
  print(min(cost))

Submission status: Wrong Answer

Solution code:
N,T = [int(x) for x in input().split()]
ans =100000000
for i in range(N):
  c,t =[int(x) for x in input().split()]
  if t<=T:
    ans = min(c,ans)
print(ans)

Submission status: Wrong Answer

Solution code:
n,t1 = map(int,input().split())
ls = []
ans = 1000
for i in range(n):
    c,t2 = map(int,input().split())
    if t1 >= t2:
        ans = min(c,ans)
    
if ans != 1000:
    print(ans)
else:
    print("TLE")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
N,T= map(int,input().split())

c=[]
t=[]

for _ in range(N):
	C,T=map(int,input().split())
	c.append(C)
	t.append(T)
	
for j in range(N):
	if t[j]>T:
		c[j]=1001

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

else:
	print(min(c))

Submission status: Wrong Answer

Solution code:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
N,T= map(int,input().split())

c=[]
t=[]

for _ in range(N):
	C,T=map(int,input().split())
	c.append(C)
	t.append(T)
	
for j in range(N):
	if t[j]>T:
		c[j]=1001

print(min(c))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

N, T = map(int,input().split())
ct=[list(map(int, input().split())) for _ in range(N)]
ans = 10000
for i in range(N):
    if ct[i][1] > T: continue
    ans = min(ans,ct[i][0])
print(ans)

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
C = 1000
flag = 0
for i in range(N):
    c, t = map(int, input().split())
    if t <= T and c < C:
        C = c
        flag = 1

if flag == 1:
    print(C)
else:
    print('TLE')

Submission status: Wrong Answer

Solution code:
n,t = map(int,input().split())
c,t1,li = [],[],[]
for i in range(n):
    c1,t2 = map(int,input().split())
    c.append(c1)
    t1.append(t2)

num = 0
for i in range(n):
    if t1[i] > t:
        num += 1
    elif t1[i] <= t:
        li.append(c[i])

if num == n:
    print("TLC")
else:
    print(min(li))

Submission status: Wrong Answer

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

mincost = T+1
for i in range(N):
    a = input().split()
    if int(a[1]) > T:
        continue
    else:
        if int(a[0]) < mincost:
            mincost = int(a[0])
if mincost == T+1:
    print("TLE")
    sys.exit()
print(mincost)

Submission status: Wrong Answer

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

mincost = T
for i in range(N):
    a = input().split()
    if int(a[1]) > T:
        continue
    else:
        if int(a[0]) < mincost:
            mincost = int(a[0])
import sys
if mincost == T:
    print("TLE")
    sys.exit()
print(mincost)

Submission status: Wrong Answer

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

mincost = T
for i in range(N):
    a = input().split()
    if int(a[1]) > T:
        continue
    else:
        if int(a[0]) < mincost:
            mincost = int(a[0])
print(mincost)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

r=1+t

for _ in range(n):
  a,b=map(int,input().split())
  if b<=t and a<r:
    r=a
if r==1+t:
  print("TLE")
else:
  print(r)

Submission status: Wrong Answer

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

r=t+1

for _ in range(n):
  a,b=map(int,input().split())
  if b<=t and a<r:
    r=a
if r==t+1:
  print("TLE")
else:
  print(r)

Submission status: Wrong Answer

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

r=t+1

for _ in range(n):
  a,b=map(int,input().split())
  if b<=t:
    r=min(r,a)
if r==t+1:
  print("TLE")
else:
  print(r)

Submission status: Wrong Answer

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

r=t+100000000000000000000000000000

for _ in range(n):
  a,b=map(int,input().split())
  if b<=t:
    r=min(r,a)
if r>t:
  print("TLE")
else:
  print(r)

Submission status: Wrong Answer

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

r=t+1

for _ in range(n):
  a,b=map(int,input().split())
  if b<=t:
    r=min(r,a)
if r>t:
  print("TLE")
else:
  print(r)

Submission status: Wrong Answer

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

r=t+1

for _ in range(n):
  a,b=map(int,input().split())
  if b<=t:
    r=min(r,a)
if r>t:
  print("TLE")
else:
  print(r)

Submission status: Wrong Answer

Solution code:
n,c=map(int,input().split())
cost=c+1
for _ in range(n):
  a,b=map(int,input().split())
  if b<=c:cost=min(cost,a)
print("TLE" if cost>c else cost)

Submission status: Wrong Answer

Solution code:
n,c=map(int,input().split())
cost=c+1
for _ in range(n):
  a,b=map(int,input().split())
  if b<=c:cost=a
print("TLE" if cost>c else cost)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for ct in cts:
  if ct[-1]>t:
    pass
  else:
    print(ct[0])
    sys.exit()

print('TLE')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

cost = 1001

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

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

Submission status: Wrong Answer

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

cost = 1001

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

print(cost)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
min = 100000
for i in range(N):
    min_temp, T_temp = map(int, input().split())
    if min_temp < min and T_temp <= T:
        min = min_temp

print(min)

Submission status: Wrong Answer

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

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

c = 1000
c_i = -1

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

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

Submission status: Wrong Answer

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

ans = []

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = []
for i in ct:
    if i[1] <= T:
        ans.append(i[0])
if len(ans) == 0:
    print('TEL')
else:
    print(min(ans))

Submission status: Wrong Answer

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

ans = []
for i in ct:
    if i[1] <= T:
        ans.append(i)
if len(ans) == 0:
    print('TEL')
else:
    print(min(ans, key=lambda x: x[0])[0])

Submission status: Wrong Answer

Solution code:
n, T = map(int, input().split())
ct = [list(map(int, input().split())) for _ in range(n)]
li = []
lim = 1001
for i in ct:
    if i[0] < lim or i[1] < lim:        
        if i[1] <= T:
            li.append(i[0])
if len(li) != 0:
    print(min(li))
else:
    print('TEL')

Submission status: Wrong Answer

Solution code:
n, T = map(int, input().split())
ct = [list(map(int, input().split())) for _ in range(n)]
li = []
for i in ct:
    if i[1] <= T:
        li.append(i[0])
if len(li) != 0:
    print(min(sorted(li)))
else:
    print('TEL')

Submission status: Wrong Answer

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

ans = sorted(set(ans))

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

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
ct = [list(map(int,input().split())) for _ in range(N)]
ans = []
for c, t in ct:
    if t <= T:
        ans.append(c)
    else:
        ans.append(0)

ans = sorted(set(ans))
if sum(ans) == 0 :
    print('LTE')
elif ans[0] == 0 :
    print(sum(ans[0:1]))
else:
    print(min(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

print(ans)

Submission status: Wrong Answer

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

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

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
n, t = map(int, input().split())
ct = [list(map(int, input().split())) for _ in range(n)]
ans = 2000
for i in ct:
    if i[1] <= t and ans >= i[0]:
        ans = i[0]

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

c_l = list()
t_l = list()

for i in range(n):
  c, t = map(int, input().split())
  if t < T:
    c_l.append(c)
    t_l.append(t)
  else:
    pass

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n,t = map(int,input().split())
ma = 1001
for i in range(n):
    c,ti = map(int,input().split())
    if ti < t+1:
        if c< ma: ma=c
print(ma if ma !=1000 else"TLE")

Submission status: Wrong Answer

Solution code:
n, t = map(int, input().split())
k = [list(map(int, input().split())) for _ in range(n)]
a = [item[0] for item in k if item[1] <= t]
if k:
  print(min(k))
else:
  print("TLE")

Submission status: Wrong Answer

Solution code:
Tmp = []
Tmp = input().rstrip().split(' ')
 
nN = int(Tmp[0])
nT = int(Tmp[1])
 
nCost = 1001
nAns = 0
 
for i in range(nN):
  Tmp = input().rstrip().split(' ')
 
  nTmpCost = int(Tmp[0])
  nTmpT = int(Tmp[1])
  
  if nTmpT < nT and nTmpCost < nCost:
    nCost = nTmpCost
    nAns = i+1

if nAns == 0:
  print('TLE')
else:
  print(nCost)

Submission status: Wrong Answer

Solution code:
Tmp = []
Tmp = input().rstrip().split(' ')

nN = int(Tmp[0])
nT = int(Tmp[1])

nCost = 1001
nAns = 0

for i in range(nN):
  Tmp = input().rstrip().split(' ')

  nTmpCost = int(Tmp[0])
  nTmpT = int(Tmp[1])
  
  if nTmpT < nT and nTmpCost < nCost:
    nCost = nTmpCost
    nAns = i+1

if nAns == 0:
  print('TLE')
else:
  print(nAns)

Submission status: Wrong Answer

Solution code:
n, t = map(int, input().split())
_list = [input() for i in range(n)]
costs, times = [], []
for elem in _list:
    cost, time = map(int, elem.split())
    costs.append(cost)
    times.append(time)

min_cost = 1001  # 最小コストを入れる変数。初期値は制約上のMAX + 1 にしておく
for cost, time in zip(costs, times):
    if time <= t and cost < min_cost:
        min_cost = cost

if min_cost < 1000:
    print(min_cost)
else:
    print('TLE')

Submission status: Wrong Answer

Solution code:
n, t = map(int, input().split())
_list = [input() for i in range(n)]
costs, times = [], []
for elem in _list:
    print(elem)
    cost, time = map(int, elem.split())
    costs.append(cost)
    times.append(time)

min_cost = 1001  # 最小コストを入れる変数。初期値は制約上のMAX + 1 にしておく
for cost, time in zip(costs, times):
    if time <= t and cost < min_cost:
        min_cost = cost

if min_cost < 1000:
    print(min_cost)
else:
    print('TLE')