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())
cost=1001
ans=0
for i in range(N):
    c,t=map(int,input().split())
    if t<T and c<cost:
        cost=c
        ans=cost
if ans==0:
    print('TLE')
else:
    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 and c<cost:
        cost=c
print(cost)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
List = []
List2 = []
min = 1000

for i in range(N):
    M, B = map(int, input().split())
    List.append([M,B])
    M, B = 0, 0

for k in range(N):
    if int(List[k][1]) <= T:
        List2.append(List[k])

for n in range(len(List2)):
    if List2[n][0] <= min:
        min = List2[n][0]

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

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
List = []
List2 = []
min = float('inf')

for i in range(N):
    M, B = map(int, input().split())
    List.append([M,B])
    M, B = 0, 0

for k in range(N):
    if int(List[k][1]) <= T:
        List2.append(List[k])

for n in range(len(List2)):
    if List2[n][0] <= min:
        min = List2[n][0]

if min > T:
    print('TLE')
else:
    print(min)

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
List = []
List2 = []
min = 1000

for i in range(N):
    M, B = map(int, input().split())
    List.append([M,B])
    M, B = 0, 0

for k in range(N):
    if int(List[k][1]) <= T:
        List2.append(List[k])

for n in range(len(List2)):
    if List2[n][0] <= min:
        min = List[n][0]

if min > T:
    print('TLE')
else:
    print(min)

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
List = []
List2 = []
min = 1000

for i in range(N):
    M, B = map(int, input().split())
    List.append([M,B])
    M, B = 0, 0

for k in range(N):
    if int(List[k][1]) <= T:
        List2.append(List[k])

for n in range(len(List2)):
    if List2[n][0] <= min:
        min = List[n][0]

print(min)

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
List = []
List2 = []
min = 1000

for i in range(N):
    M, B = map(int, input().split())
    List.append([M,B])
    M, B = 0, 0

for k in range(N):
    if int(List[k][1]) <= T:
        List2.append(List[k])

for n in range(len(List2)):
    if List2[n][0] <= min:
        min = List[n][0]

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

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
List = []
List2 = []
min = 1000

for i in range(N):
    M, B = map(int, input().split())
    List.append([M,B])
    M, B = 0, 0

for k in range(N):
    if int(List[k][1]) <= T:
        List2.append(List[k])

for n in range(len(List2)):
    if List2[n][0] <= min:
        min = List[n][0]

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, L =map(int, input().split())
cost = 1000
count = 0
for i in range(N):
  c, t =map(int, input().split())
  if t <= L:
    if c < cost:
      cost = c
      count += 1
  elif t > L:
    continue;
if count == 0:
  print("TLE")
else:
  print(cost)

Submission status: Wrong Answer

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

ans = 10**8
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,T=map(int,input().split())
cc=1000
for i in range(N):
  c,t=map(int,input().split())
  if cc>c and T>=t:
    cc=c
if cc==1000:
  print("TLE")
else:
  print(cc)

Submission status: Wrong Answer

Solution code:
def solve():
    n,t = map(int,input().split())
    mn = 10**9
    for _ in range(n):
        a,b = map(int,input().split())
        if b<=t:
            mn = min(mn,a)
    if mn<=t:
        print(mn)
    else:
        print('TLE')
if __name__=='__main__':
    solve()

Submission status: Wrong Answer

Solution code:
N,T=map(int,input().split())
c_t=[]
mincos=1000
for c,t in zip(range(N),range(N)):
    c,t=map(int,input().split())
    if t<=T:
        if c<mincos:
            mincos=c

print("TLE" if mincos==1000 else mincos)

Submission status: Wrong Answer

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

mini = 10**9
flg = False
for i in range(n):
    c, t = map(int, input().split())
    if T > t:
        flg = True
        if mini > t:
            ans = c
if flg: print(c)
else: print('TLE')

Submission status: Wrong Answer

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

ct=sorted(ct, key=lambda x:(x[0],x[1]))

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

Submission status: Wrong Answer

Solution code:
N,T=map(int,input().split())
cost=100
for s in range(N):
    c,t=map(int,input().split())
    if t<=T:
        if c<cost:
            cost=c
    else:
        continue
print(cost if cost!=100 else 'TLE')

Submission status: Wrong Answer

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

ct = sorted(ct, key=lambda h: (h[1], h[0]))

if ct[0][1]<=T:
    print(ct[0][0])
else:
    print('TLE')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

CT=[[0,0]]*N
i=0
while i<N:
    CT[i]=list(map(int,input().split()))
    i+=1

CT=sorted(CT)

print(CT)

ans='TLE'
for x,y in CT:
    if y<=T:
        ans=x
        break
print(ans)

Submission status: Wrong Answer

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

CT=[[0,0]]*N
i=0
while i<N:
    CT[i]=map(int,input().split())
    i+=1

ans='TLE'
for x,y in CT:
    if y<=T:
        ans=x
print(ans)

Submission status: Wrong Answer

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

for i in range(n):
    c, t = map(int, input().split())
    cost.append(c)
    time.append(t)

for c, t in zip(cost, time):
    if t <= T and ans > c:
        ans = c

print(ans if ans != 1000 else 'TLE')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

#print(ci,ti)

lowest=1000

for i in range(N):
  if ti[i]<=T and ci[i]<=lowest:
    lowest=ci[i]
if max(ti)>T:
  print('TLE')
else:
  print(lowest)

Submission status: Wrong Answer

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

#print(ci,ti)

lowest=1000

for i in range(N):
  if ti[i]<=T and ci[i]<=lowest:
    lowest=ci[i]

print(lowest if lowest<=T else 'TLE')

Submission status: Wrong Answer

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

#print(ci,ti)

lowest=max(ci)*2

for i in range(N):
  if ti[i]<=T and ci[i]<=lowest:
    lowest=ci[i]

print(lowest if lowest<=T else 'TLE')

Submission status: Wrong Answer

Solution code:
n, T = map(int, input().split())
out = list()
for _ in range(n):
    c, t = map(int, input().split())
    # if t > T: continue
    out.append((c, t))
print(min(out)[0]) if out and min(out)[0] <= T else print("TLE")

Submission status: Wrong Answer

Solution code:
n, T = map(int, input().split())
out = list()
for _ in range(n):
    c, t = map(int, input().split())
    if t > T: continue
    out.append((c, t))
print(min(out)[0]) if out and min(out)[0] <= T else print("TLE")

Submission status: Wrong Answer

Solution code:
n, T = map(int, input().split())
out = list()
for _ in range(n):
    c, t = map(int, input().split())
    if t > T: continue
    out.append((c, t))
print(min(out)[0]) if out and min(out)[0] < T else print("TLE")

Submission status: Wrong Answer

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(ans, t)
if ans == 2000:
  print('TLE')
else:
  print(ans)

Submission status: Wrong Answer

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

aux, j, k=[0, 0], 0, 0
for i in range(N):
	c, t = map(int, input().split())
	
	if(T==t):
		aux[0],aux[1]=c, t
		k+=1
	elif(k==0):
		if (j == 0 and t<=T):
			aux[0],aux[1]=c, t
			j+=1
		elif(aux[1]>t):
			aux[0],aux[1]=c, t

if (aux[1]==0):
	print("TLE")
else: 
	print(aux[0])

Submission status: Wrong Answer

Solution code:
line = input()
X, Y = [int(n) for n in line.split()]

value = "TLE"
route_cost = []
for i in range(X):
    line = input()
    cost, time = [int(n) for n in line.split()]
    route_cost.append([cost, time, i])

route_cost.sort(key=lambda x: x[0])
for cost, time, i in route_cost:
    if time > Y:
        continue
    else:
        value = i
    print(value)

Submission status: Wrong Answer

Solution code:
def main():
    line = input()
    n, T = [int(x) for x in line.split()]
    lista_tempos = []
    lista_custos = []
    for i in range(n):
        line = input()
        c, t = [int(x) for x in line.split()]
        if t <= T:
            lista_tempos.append(t)
            lista_custos.append(c)
    if lista_tempos:
        print(min(lista_custos))
    else:
        print('TLE')

Submission status: Wrong Answer

Solution code:
line = input()
X, Y = [int(n) for n in line.split()]

route_cost = []
for _ in range(X):
    line = input()
    key, cost = [int(n) for n in line.split()]
    route_cost.append([cost, key])
    
route_cost.sort(key=lambda x: x[0])
if route_cost[0][0] > Y:
    value = "TLE"
else:
    value = route_cost[0][1]

print(value)

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
M = 10000
for n in range(N):
    c, t = map(int, input().split())
    if T >= t:
        M = min(M, c)
print(M)

Submission status: Wrong Answer

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

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n,T = LI()
ct = [LI() for _ in range(n)]
ct.sort()
for c,t in ct:
    if t < T:
        print(c)
        quit()
print('TLE')

Submission status: Wrong Answer

Solution code:
N,T=map(int,input().split())
CT=[]
for i in range(N):
    ct=list(map(int,input().split()))
    CT.append(ct)
min_cost=10000
for i in range(1,N):
    semi_ans=CT[i]
    if semi_ans[1]<=T:
        ans=CT[i]
        if ans[0]<min_cost:
            min_cost=CT[i][0]
if min_cost==10000:
    print("TLE")
else:
    print(min_cost)

Submission status: Wrong Answer

Solution code:
a=list(map(int,input().split()))
b=[]
c=100
for i in range(a[0]):
    b.append(list(map(int,input().split())))
for j in range(a[0]):
    if b[j][1]<=a[1] and c>b[j][0]:
        c=b[j][0]
if c!=100:
    print(c)
else:
    print("TLE")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

cost = 0
count = 0
for i in range(N):
    if lists[i][1] <= T:
        count += 1
        if i == 0:
            cost = lists[i][0]
        elif cost >= lists[i][0]:
            cost = lists[i][0]
        else:
            continue
    else:
        continue
if count == 0:
    print("TLE")
else:
    print(cost)

Submission status: Wrong Answer

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

cost = 0
count = 0
for i in range(N):
    if lists[i][1] <= T:
        if i == 0:
            cost = lists[i][0]
            count += 1
        elif cost > lists[i][0]:
            cost = lists[i][0]
            count += 1
        else:
            count += 1
            continue
    else:
        continue
if count == 0:
    print("TLE")
else:
    print(cost)

Submission status: Wrong Answer

Solution code:
#template
def inputlist(): return [int(j) for j in input().split()]
from collections import Counter
#template
#issueから始める
N,T = inputlist()
ans = 10**9
for i in range(N):
    c,t = inputlist()
    if t <= T:
        ans = min(ans,c)
if ans == 10**9+7:
    ans = 'TLE'
print(ans)

Submission status: Wrong Answer

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



    mn = 1001
    for i in range(N):
        if lst[i]["cost"] <= mn and lst[i]["time"] < T:
            mn = lst[i]["cost"]
    if mn > 1000:
        print("TLE")
    else:
        print(mn)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#n 経路の数
#t 時間
# cost 時間
n,t = map(int,input().split())
#cost_time = [input().split() for i in range(n)]
cost_time = [list(map(int,input().split())) for i in range(n)]
result =float('inf')

inf =  float("inf")
for i in range(n):
    time = cost_time[i][1]
    if t >= time and result >= cost_time[i][0]:
       result = cost_time[i][0]
      
if result == inf:
    print("TLF")
else:
    print(result)

Submission status: Wrong Answer

Solution code:
#n 経路の数
#t 時間
# cost 時間
n,t = map(int,input().split())
#cost_time = [input().split() for i in range(n)]
cost_time = [list(map(int,input().split())) for i in range(n)]
result = 11111111111111111111

for i in range(n):
    time = cost_time[i][1]
    if t >= time and result >= cost_time[i][0]:
       result = cost_time[i][0]
      
if result == 11111111111111111111:
    print("TLF")
else:
    print(result)

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
i = 0
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, T = map(int, input().split())
i = 0
ans = 1001
for i in range(N):
    c, t = map(int, input().split())
    if T > t and c < ans:
        ans = c

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

ans = 101010
for c, t in CT:
    if t <= T:
        ans = min(ans, c)

print(ans if ans <= T else 'TLE')

Submission status: Wrong Answer

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

ans = 1010
for c, t in CT:
    if t > T:
        continue
    ans = min(ans, c)
print(ans if ans <= T else 'TLE')

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
import os


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N, T = list(map(int, sys.stdin.readline().split()))
    ct = [list(map(int, sys.stdin.readline().split()))for i in range(N)]

    ret = float('inf')
    for n in range(N):
        if T >= ct[n][1] and ret > ct[n][0]:
            ret = ct[n][0]

    print('LTE' if ret == float('inf') else ret)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, T = map(int,input().split())
cnt = T
jdg = False
for _ in range(N):
    c, t = map(int,input().split())
    if t <= T: 
        cnt = min(cnt,c)
        jdg = True
        
if jdg:
    print(cnt)
else:
    print("TLE")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, T = list(map(int, input().split()))
A = [list(map(int, input().split())) for _ in range(N)]
ans, sav = 1000, 0
for i in A:
    if i[1] <= T:
        sav = i[0]
        if ans > sav:
            ans = sav
if ans == 1000:
    ans = "TLE"
print(ans)

Submission status: Wrong Answer

Solution code:
n,T = map(int,input().split())
ct = []
mn = 1001
for i in range(n):
    c,t = map(int,input().split())
    if T >= t:
        if mn > c:
            mn = c
print("TLE" if mn==10**9 else mn)

Submission status: Wrong Answer

Solution code:
n, t = map(int, input().split())
ans = float('inf')
for _ in range(n):
    x, y = map(int, input().split())
    if y <= t:
        ans = min(ans, x)
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=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, T = map(int, input().split())

ans = 10**15

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, input().split())
    
ans = 10**9
for _ in range(n):
    c, t = map(int, input().split())
    if t < T and c < ans:
        ans = c
    
if ans == 10**9:
    print('TLE')
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
N, T = map(int,input().split())
mincost = 1001
for i in range(1, N+1):
    c, t = map(int,input().split())
    if t <= T:
        cost = c
        if cost < mincost:
            mincost = cost

if mincost == 1000:
  print('TLE')
if mincost < 1000:
  print(mincost)

Submission status: Wrong Answer

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

if mincost == 1000:
  print('TLE')
if mincost < 1000:
  print(mincost)

Submission status: Wrong Answer

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

c_min = 1000
t_ = None
for _ in range(N):
    c, t = map(int, input().split())
    if T >= t and c_min > c:
        c_min = c
        t_ = t
if t_ == None:
    print("TLE")
else:
    print(c_min)

Submission status: Wrong Answer

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

for i in range(N):
  if int(c[i][1]) <= T:
    num = min(num, int(c[i][0]))
    
print(num)

Submission status: Wrong Answer

Solution code:
n,t=map(int,input().split())
ans=1000
for _ in range(n):
  cost,time=map(int,input().split())
  if time<=t:
    ans=min(ans,cost)
print(ans)

Submission status: Wrong Answer

Solution code:
n,t = map(int,input().split())
lis = []
for i in range(n):
    x = list(map(int,input().split()))
    lis.append(x)
ans = 1000    
for j in lis:
    if j[1] <= t and j[0] <= ans:
        ans = j[0]
if ans == 1000:
    print("TLE")
else:
    print(ans)

Submission status: Wrong Answer

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

time = dict()
for i in range(N):
	c,t = input().split(" ")
	time[int(c)] = int(t)
cost = 10000
#print(sorted(time.items(), key=lambda item: item[1]))
for key, value in sorted(time.items(), key=lambda item: item[1]):
	if value <= T:
		if cost > key:
			cost = key
			# print(cost)

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

Submission status: Wrong Answer

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

time = dict()
for i in range(N):
	c,t = input().split(" ")
	time[int(c)] = int(t)
cost = 10000
print(sorted(time.items(), key=lambda item: item[1]))
for key, value in sorted(time.items(), key=lambda item: item[1]):
	if value <= T:
		if cost > key:
			cost = key
			# print(cost)

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

Submission status: Wrong Answer

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

time = dict()
for i in range(N):
	c,t = input().split(" ")
	time[int(c)] = int(t)
for key, value in sorted(time.items(), key=lambda item: item[1]):
	if value <= T:
		print(key)
		break
	else:
		print("TLE")
		break

Submission status: Wrong Answer

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

time = dict()
for i in range(N):
	c,t = input().split(" ")
	time[int(c)] = int(t)
for key, value in sorted(time.items(), key=lambda item: item[1]):
	if value <= T:
		print(value)
		break
	else:
		print("TLE")
		break

Submission status: Wrong Answer

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

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)

Submission status: Wrong Answer

Solution code:
import sys
import math
import itertools

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

Submission status: Wrong Answer

Solution code:
import sys
import math
import itertools

n,T=list(map(int,input().split()))
min=9999
for i in range(n):
	c,t=list(map(int,input().split()))
	if T>=t:
		if min>c:
			min=c
print(c)

Submission status: Wrong Answer

Solution code:
N,T=map(int,input().split())
p=[]
for _ in range(N):
  c=list(map(int,input().split()))
  p.append(c)
ans=9999
for c in p:
  if c[1]<T:
    if c[0]<ans:
      ans=c[0]
if ans==9999:
  print('TLE')
else:
  print(ans)

Submission status: Wrong Answer

Solution code:
def p_b():
    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 * t)
    print(ans if ans != 10 ** 9 else "TLE")
    
p_b()

Submission status: Wrong Answer

Solution code:
N,T=map(int,input().split())
m=10001
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())
m=10001
for i in range(N):
    c,t=map(int,input().split())
    if t<=70: m=min(m,c)
print(m)

Submission status: Wrong Answer

Solution code:

N,T = map(int,input().split())
ans = [1000,0]
status = 0

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

    if t <= T and c < ans[0]:
        ans[0] = c
        ans[1] = t
        status = 1
    else:
        pass

if status == 0:
    print("TLE")
else:
    print(ans[0])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

n, T, *ct = map(int, sys.stdin.read().split())
ct = zip(*[iter(ct)] * 2)

def main():
    res = float('inf')
    for c, t in ct:
        if t <= T:
            res = min(res, c)
    
    return res

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

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
N, T = map(int, input().split())
min = 1000
flag = False
for i in range(N):
    c, t = map(int, input().split())
    if t <= T and c < min:
        min = c
        flag = True
if flag:
    print(min)
else:
    print("TLE")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans=10**51
for k in range(N):
    if t[k]<= T:
        ans = min(ans, c[k])
        
print(ans)

Submission status: Wrong Answer

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

ans=2**51
for k in range(N):
    if t[k]<= T:
        ans = min(ans, c[k])
        
print(ans)

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
flag = False
min_cost = 10 ** 3
for i in range(N):
    c, t = map(int, input().split())
    if t <= T:
        if c < min_cost:
            min_cost = c
            flag = True

print(min_cost if flag == True else 'TLE')

Submission status: Wrong Answer

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

ans = -1
cst = 10**5
for i in range(n):
    c,tm = map(int,input().split())
    if tm < t and c <cst:
        cst = c
        ans = c

if ans == -1:
    print("TLE")
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
n,t=map(int,input().split())
tici=[]
for i in range(n):
	ci,ti=map(int,input().split())
	if(ti<=t):
		tici.append([ti,ci])
if(len(tici)==0):
	print('TLE')
else:
	tici.sort()
	print(tici[0][1])

Submission status: Wrong Answer

Solution code:
n,t = map(int, input().split())
k = [list(map(int, input().split())) for i in range(n)]
mincost=1000000
for i in range(n):
  if k[i][-1]<=t:
    cost=k[i][0]
    mincost=min(mincost,cost)
  
print(mincost)

Submission status: Wrong Answer

Solution code:
A,B = map(int,input().split())
q = 100000
for i in range(A):
  S = list(map(int,input().split()))
  if S[1] <= B and S[0] < q:
    q=S[0]
  else:
    pass
if q < 1000:
  print(q)
else:
  print('TLE')

Submission status: Wrong Answer

Solution code:
A,B = map(int,input().split())
q = 101
for i in range(A):
  S = list(map(int,input().split()))
  if S[1] <= B and S[0] < q:
    q=S[0]
  else:
    pass
if q != 101:
  print(q)
else:
  print('TLE')

Submission status: Wrong Answer

Solution code:
A,B = map(int,input().split())
q = 0
for i in range(A):
  S = list(map(int,input().split()))
  if i == 0 and S[1] <= B:
    p = S[0]
    q = p
  elif S[1] <= B and S[0] < q:
    q=S[0]
  else:
    pass
if q != 0:
  print(q)
else:
  print('TLE')

Submission status: Wrong Answer

Solution code:
n,t = map(int, input().split())
c = 100000000
for i in range(n):
    a,b = map(int, input().split())
    if b<=t:
        c = min(a,c)
print("TLE" if c == 10000000 else c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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