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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
CT = [tuple(map(int, input().split())) for _ in range(N)]
res = 1001
for c, t in CT:
    if t <= T:
        res = min(res, c)
print(res if res < 1000 else 'TLE')

Submission status: Wrong Answer

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

ans = 1000

for i in range(n):
    if t[i] <= T:
        ans = min(ans, c[i])
print(ans if ans != 1000 else "TLE")

Submission status: Wrong Answer

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

ans = 1000

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

Submission status: Wrong Answer

Solution code:
n, t = map(int, input().split())
c = 10000
for i in range(n):
    tmp = input().split()
    if t >= int(tmp[1]):
        if int(tmp[0]) < c:
            c = int(tmp[0])
if c == 999:
    print('TLE')
    exit()
else:
    print(c)

Submission status: Wrong Answer

Solution code:
n, t = map(int, input().split())
c = 999
for i in range(n):
    tmp = input().split()
    if t >= int(tmp[1]):
        if int(tmp[0]) < c:
            c = int(tmp[0])
if c == 999:
    print('TLE')
    exit()
else:
    print(c)

Submission status: Wrong Answer

Solution code:
n, t = map(int, input().split())
c = 999
for i in range(n):
    tmp = input().split()
    if t >= int(tmp[1]):
        if int(tmp[0]) < int(c):
            c = tmp[0]
if c == 999:
    print('TLE')
    exit()
else:
    print(c)

Submission status: Wrong Answer

Solution code:
n, t = map(int, input().split())
c = 999
for i in range(n):
    tmp = input().split()
    if int(tmp[1]) > t:
        pass
    elif int(tmp[1]) <= t:
        if int(tmp[0]) < int(c):
            c = tmp[0]
    else:
        pass
if i == n-1 and c == 999:
    print('TLE')
    exit()
else:
    print(c)

Submission status: Wrong Answer

Solution code:
n, t = map(int, input().split())
c = 999
for i in range(n):
    tmp = input().split()
    if int(tmp[1]) > t:
        pass
    elif int(tmp[1]) <= t:
        if int(tmp[0]) <= int(c):
            c = tmp[0]
    else:
        pass
if i == n-1 and c == 999:
    print('TLE')
    exit()
else:
    print(c)

Submission status: Wrong Answer

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    N, T = LI()
    ans = inf
    for i in range(N):
        c, t = LI()
        if t <= T:
            ans = min(ans, c)
    print(ans)

main()

Submission status: Wrong Answer

Solution code:
a,b=input().split()
a=int(a)
b=int(b)
c=[input().split() for i in range(a)]
d=1001
for i in range(a-1):
  if int(c[i][1])<=b:
    if d>int(c[i][0]):
      d=int(c[i][0])
if d==1001:
  print("TLE")
else:
  print(d)

Submission status: Wrong Answer

Solution code:
a,b=input().split()
a=int(a)
b=int(b)
c=[input().split() for i in range(a)]
d=1001
for i in range(a-1):
  if int(c[i][1])<=b:
    if d>int(c[i][0]):
      d=int(c[i][0])
print(d)

Submission status: Wrong Answer

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

max_cost = 10 ** 9

for _ in range(n):
  c, tt = map(int, input().split())
  if tt <= t:
    max_cost = max(max_cost, c)
    
print('TLE' if max_cost == 10 ** 9 else max_cost)

Submission status: Wrong Answer

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

min_cost = 10 ** 9

for _ in range(n):
  c, tt = map(int, input().split())
  if tt <= t:
    min_cost = min(min_cost, c)
    
print(min_cost)

Submission status: Wrong Answer

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

max_cost = 10 ** 9

for _ in range(n):
  c, tt = map(int, input().split())
  if tt <= t:
    max_cost = max(max_cost, c)
    
print(max_cost)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,t = map(int, input().split())
y = 10**5
for i in range(n):
    c,x = map(int,input().split())
    if x<=t:
        y=min(y,c)
if y != 10**5:
    print(y)
else:
    print("TEL")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

if res <= T:
    print(res)
else:
    print("TLE")

Submission status: Wrong Answer

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

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

if res <= T:
    print(res)
else:
    print("TLE")

Submission status: Wrong Answer

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

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

if res <= T:
    print(res)
else:
    print("TLE")

Submission status: Wrong Answer

Solution code:
n, t = map(int, input().split())
res = t + 1
for i in range(n):
    ci, ti = map(int, input().split())
    if ti <= t:
        res = min(res, ci)

if res == t + 1:
    print("TLE")
else:
    print(res)

Submission status: Wrong Answer

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

ans = 10**9

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,T=map(int,input().split())
nm=1000000
ans=0
for i in range(N):
  c,t=map(int,input().split())
  if nm>c*t:
    ans=c
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,T=map(int,input().split())
List = []
for i in range (N):
  List.append(list(map(int, input().split())))
res = 1001
for i in range(N):
  if List[i][1] < T:
    res = min(res,List[i][0])
print(res)

Submission status: Wrong Answer

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

ans = 10000

for i in range(n):
    cost,time = map(int,input().split())
    
    if time <= lim and cost < ans:
        ans = cost

if ans != 10000:
    print("TLE")
else:
    print(ans)

Submission status: Wrong Answer

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

ans = 10000

for i in range(n):
    cost,time = map(int,input().split())
    
    if time <= lim and cost < ans:
        ans = cost
        
print(ans)

Submission status: Wrong Answer

Solution code:
# その19 ABC112 B - Time Limit Exceeded

N,T = map(int,input().split())
C = []
D = []

for i in range(N):
    A,B = map(int,input().split())
    C.append(A)
    D.append(B)
if min(D) > T:
    print('TLE')
else :
    F=[]
    for i in range(N):
        if min(D) == D[i]:
            F.append(C[i])
    print(min(F))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

c_ans = 1000
for ct in cts:
    if ct[1] <= t:
        c_ans = min(c_ans, ct[0])
print(c_ans)

Submission status: Wrong Answer

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    N, T = map(int, input().split())
    min_c = 1001
    for _ in range(N):
        c, t = map(int, input().split())
        if t <= T and c < min_c:
            min_c = c
    if min_c == 1001:
        print("LTE")
    else:
        print(min_c)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N,T = map(int,input().split())
array = []
array = [ [lista for lista in map(int,input().split())] for I in range(N) ]

min = 1000
for I in array:
    if I[1] > T:
        continue
    elif I[1] <= T:
        if I[0] < min: min = I[0]
print(min) if min < 1000 else print('TLE')

Submission status: Wrong Answer

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

cost = 100000

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

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

Submission status: Wrong Answer

Solution code:
import math
inf = float('inf')

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

min_c = inf
for i in c_t:
    if i[1] <= t:
        min_c = min(min_c, i[0])

if min_c == t+1:
    print("TLE")
else:
    print(min_c)

Submission status: Wrong Answer

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

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

min_c = 10000000000000
for i in c_t:
    if i[1] <= t and i[0] < min_c:
        min_c = i[0]

if min_c == t+1:
    print("TLE")
else:
    print(min_c)

Submission status: Wrong Answer

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

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

min_c = t + 1
for i in c_t:
    if i[1] <= t and i[0] < min_c:
        min_c = i[0]

if min_c == t+1:
    print("TLE")
else:
    print(min_c)

Submission status: Wrong Answer

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

n, t = rm()
min_ = inf
for _ in range(n):
  a, b = rm()
  if b <= t:
    min_ = min(min_, a)
print(min_)

Submission status: Wrong Answer

Solution code:
n,ct = map(int, raw_input().split(' '))
m = min([u for u,v in [raw_input().split() for _ in range(n)] if v <= ct] or [+float('inf')])
print 'TLE' if m == +float('inf') else m

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
l = input()
print(l)

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

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

Submission status: Wrong Answer

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

data = []

for i in range(n):
    tmp = input().split()
    tmp[0] = int(tmp[0])
    tmp[1] = int(tmp[1])
    data.append(tmp)

data.sort()


flg = False
for i in range(len(data)):
    if data[i][0] <= t:
        print(data[i][1])
        flg = True
        break

if not flg:
    print("TLE")

Submission status: Wrong Answer

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

data = []

for i in range(n):
    tmp = input().split()
    tmp[0] = int(tmp[0])
    tmp[1] = int(tmp[1])
    data.append(tmp)

data.sort()


flg = False
for i in range(len(data)):
    if data[i][1] <= t:
        print(data[i][1])
        flg = True
        break

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

Submission status: Wrong Answer

Solution code:
n, T = map(int, input().split())
ans = float('inf')
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:
import sys, math, itertools, collections, bisect 
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') 
inf = float('inf') ;mod = 10**9+7 
mans = inf ;ans = 0 ;count = 0 ;pro = 1

n, T = map(int, input().split())
cost = False
for i in range(n):
    c, t = map(int, input().split())
    if t > T:
        pass
    else:
        if i == 0:
            cost = c
        else:
            if cost > c:
                cost = c
if cost == False:
    print("TLE")
else:
    print(cost)

Submission status: Wrong Answer

Solution code:
# N T
# c1 t1
N, T = map(int, input().split())
c_min = 1001
for _ in range(N):
    c, t = map(int, input().split())
    if c < c_min and t < T:
        c_min = c
if c_min == 1001:
    print('TLE')
else:
    print(c_min)

Submission status: Wrong Answer

Solution code:
import sys, re
from math import ceil, floor, sqrt, pi, factorial#, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left
from functools import reduce
from decimal import Decimal, getcontext
# input = sys.stdin.readline 
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_list(N): return [s_list() for _ in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
    n, t = i_map()
    num_list = i_row_list(n)

    min_cost = INF

    for cost, time in num_list:
        if time > t:
            continue
        min_cost = min(min_cost, cost)

    print(min_cost)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N,T = map(int,input().split())
CT = []
for n in range(N):
  c,t = map(int,input().split())
  CT.append([c,t])
CT = sorted(CT,key=lambda x: x[0])
ans = False
for ct in CT:
  if ct[1] <= T:
    print(ct[0])
    ans = True
    break
if ans:
  print("TLE")

Submission status: Wrong Answer

Solution code:
N,T = map(int,input().split())
CT = []
for n in range(N):
  c,t = map(int,input().split())
  CT.append([c,t])
CT = sorted(CT,key=lambda x: x[0])
for ct in CT:
  if ct[1] <= T:
    print(ct[0])
    break

Submission status: Wrong Answer

Solution code:
N,T = map(int,input().split())
CT = []
for n in range(N):
  c,t = map(int,input().split())
  CT.append([c,t])
sorted(CT,key=lambda x: x[0])
for ct in CT:
  if ct[1] <= T:
    print(ct[0])
    break

Submission status: Wrong Answer

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

ans = '1000'

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,t = map(int,input().split())
ans = 0
for i in range(n):
  a,b = map(int,input().split())
  if t > b:
    ans = b
print(ans if ans > 0 else "TLE")

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
# Python3 (3.4.3)
import sys
input = sys.stdin.readline

# -------------------------------------------------------------
# function
# -------------------------------------------------------------


# -------------------------------------------------------------
# main
# -------------------------------------------------------------
N,T = map(int,input().split())
CT = [tuple(map(int,input().split())) for _ in range(N)]

ans = -1
nc = 9999
for i in range(N):
    c,t = CT[i]
    if t <= T and c < nc:
        ans = i

print(i+1)

Submission status: Wrong Answer

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

ct.sort(key=lambda val : val[0])
ans = 0
for i in range(n):
    if ct[i][1] <= T:
        ans = ct[i][0]
        break
print(ans)

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
ct = [list(map(int, input().split())) for _ in range(N)]
ct = sorted(ct, key=lambda x:x[1])
mx = float('inf')
for c, t in ct:
    if t <= T:
        mx = min(mx, c)
    else:
        if mx != float('inf'):
            print(mx)
            exit()
print('TLE')

Submission status: Wrong Answer

Solution code:
# input
N, T = map(int, input().split())
rhr = []
r_append = rhr.append
for i in range(1, N + 1):
    c, t = map(int, input().split())
    r_append(
        {
            "index": i,
            "cost": c,
            "time": t
        }
    )

target_routes = [
    r
    for r in rhr
    if r["time"] < T
]

if not target_routes:
    print("TLE")
else:
    target_routes.sort(key=lambda x: x["cost"])
    print(target_routes[0]["cost"])

Submission status: Wrong Answer

Solution code:
# input
N, T = map(int, input().split())
rhr = []
r_append = rhr.append
for i in range(1, N + 1):
    c, t = map(int, input().split())
    r_append(
        {
            "index": i,
            "cost": c,
            "time": t
        }
    )

target_routes = [
    r
    for r in rhr
    if r["time"] < T
]

if not target_routes:
    print("TLE")
else:
    rhr.sort(key=lambda x: x["cost"] / x["time"])
    print(rhr[0]["index"])

Submission status: Wrong Answer

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

for i in range(1,N+1):
  c, t = map(int, input().split())
  arrc.append(c)
  arrt.append(t)

if min(arrt) > T:
  print("TLE")
else:
  temp = arrt.index(min(arrt))
  print(arrc[temp])

Submission status: Wrong Answer

Solution code:
n,t=map(int,input().split())
l1=[]
l2=[]
while n>0:
    a,b=(map(int,input().split()))
    l1.append(a)
    l2.append(b)
    n-=1
mn=[]
for i in range(n):
    if l2[i]>t:
        l1.remove(l1[i])
        l2.remove(l2[i])
print(min(l1))
print(l1)
print(l2)

Submission status: Wrong Answer

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

print("TLE" if ans==10000 else ans)

Submission status: Wrong Answer

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

print("TLE" if ans==10000 else ans)

    



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

Submission status: Wrong Answer

Solution code:
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    n,t=map(int, input().split())
    costmin=1000
    for i in range(n):
        c,tt=map(int, input().split())
        if tt<=t:
            costmin=min(c,costmin)
    if costmin==1000:
        print('TLE')
    else:
        print(costmin)
resolve()

Submission status: Wrong Answer

Solution code:
N,T = map(int, input().split())
min_cost = 10**9
for i in range(N):
    c,t = map(int, input().split())
    if T >= t and min_cost > c:
        min_cost = c
print(min_cost)

Submission status: Wrong Answer

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

c_init = 10 * 4
ans = c_init
for _ in range(n):
    c, t = [int(x) for x in input().split()]
    if (t <= tl) and (c < ans):
        ans = c
if ans == c_init:
    ans = "TLE"
print(ans)

Submission status: Wrong Answer

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

c_init = 10 * 100
ans = c_init
for _ in range(n):
    c, t = [int(x) for x in input().split()]
    if t <= tl and c < ans:
        ans = c
if ans == c_init:
    ans = "TLE"
print(ans)

Submission status: Wrong Answer

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

c_init = 10 * 5
ans = c_init
for _ in range(n):
    c, t = [int(x) for x in input().split()]
    if t <= tl and c < ans:
        ans = c
if ans == c_init:
    ans = "TLE"
print(ans)

Submission status: Wrong Answer

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

c_init = 10 * 4
ans = c_init
for _ in range(n):
    c, t = [int(x) for x in input().split()]
    if t <= tl and ans > c:
        ans = c
if ans == c_init:
    ans = "TLE"
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,T=map(int,input().split())
data=[input().split() for i in range(n)]
lc=[]
for row in data:
    if int(row[1]) <=T:
        lc.append(row[0])

if not lc:
    print("TLE")
else:
    a=sorted(lc)
    print(a[0])

Submission status: Wrong Answer

Solution code:
n,T=map(int,input().split())
data=[input().split() for i in range(n)]
lc=[]
for row in data:
    if int(row[1]) <=T:
        lc.append(row[0])
if not lc:
    print("TLE")
else:
    print(min(lc))

Submission status: Wrong Answer

Solution code:
n, limit = map(int, input().split())
cost = list()
for _ in range(n):
  c, time = [int(a) for a in input().split()]
  if time <= limit:
    cost.append(c)
print(max(cost) if len(cost) > 0 else 'TLE')

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil
from operator import itemgetter
from copy import deepcopy
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
inf = 10**17
mod = 10**9 + 7

n,t=MI()
costs=[]
for i in range(n):
    c,ti=MI()
    if ti<t:
        costs.append(c)
if len(costs)==0:
    print("TLE")
else:
    costs.sort()
    print(costs[0])

Submission status: Wrong Answer

Solution code:
n, t = map(int, input().split())
ct = []
for i in range(n):
    c, time = map(int, input().split())
    ct.append([c, time])
min_t = t
cost = 0
cnt = 0
for i in range(n):
    if ct[i][1] > t:
        cnt += 1
    else:
        if min_t >= ct[i][1]:
            min_t = ct[i][1]
            cost = ct[i][0]
if cnt == n:
    print('TLE')
else:
    print(cost)

Submission status: Wrong Answer

Solution code:
n, t = map(int, input().split())
ct = []
for i in range(n):
    c, time = map(int, input().split())
    ct.append([c, time])
min_t = t
cost = 0
cnt = 0
for i in range(n):
    if ct[i][1] > t:
        cnt += 1
    else:
        if min_t > ct[i][1]:
            min_t = ct[i][1]
            cost = ct[i][0]
if cnt == n:
    print('TLE')
else:
    print(cost)

Submission status: Wrong Answer

Solution code:
n, t = map(int, input().split())
ct = []
for i in range(n):
    c, time = map(int, input().split())
    ct.append([c, time])
min_t = t
cost = 0
cnt = 0
for i in range(n):
    if ct[i][1] > t:
        cnt += 1
    else:
        min_t = ct[i][1]
        cost = ct[i][0]
if cnt == n:
    print('TLE')
else:
    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)
print("TLE" if m==1001 else m)

Submission status: Wrong Answer

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

res = "TLE"
cts = sorted(ct, key=lambda x: x[1])
for i in cts:
    if i[1] > t:
        pass
    else:
        res = i[0]
        break
print(res)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,T=map(int,input().split())
cost=10001
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)