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:
#112
n, t0 = map(int, input().split())
ans = 10000000000
for _ in range(n):
    c, t = map(int, input().split())
    if(t<=t0 and c<=ans):
        ans = c
if(ans==10000000000):
    print("TLE")
else:
    print(c)

Submission status: Wrong Answer

Solution code:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
N,T = [int(x) for x in input().split()]
cost = []
for _ in range(N):
    c,t = [int(x) for x in input().split()]
    if t <= T:
        cost.append(c)

if cost is True:
    print(min(cost))
else:
    print("TLE")

Submission status: Wrong Answer

Solution code:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
N,T = [int(x) for x in input().split()]
cost = []
for _ in range(N):
    c,t = [int(x) for x in input().split()]
    if t <= T:
        cost.append(c)

if cost == True:
    print(min(cost))
else:
    print("TLE")

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()
for i in ct:
    if i[1]<=t:
        print(i[0])
        break
ct.sort(key=lambda x:x[1])
if ct[-1][1]>t:
    print("TLE")

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(key=lambda x:x[1])
if ct[0][1]>t:
    print("TLE")
else:
    print(ct[0][0])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys


class DataUnit(object):

    def __init__(self, c, t):
        self.c = c
        self.t = t
        pass


def judging_TIME(t, max_T):
    if(t <= max_T): return True
    else: return False


def judging_COST(datali):

    min_cost = 10000
    for d in datali:
        if(d.c < min_cost):
            min_cost = d.c

    return min_cost


# get from std-I/O.
def loading_inputs():
    N, T = raw_input().split()
    N, T = int(N), int(T) 

    datalist = []
    for i in range(N):
        c_i, t_i = raw_input().split()
        c_i, t_i = int(c_i), int(t_i)

        if judging_TIME(t_i, T):
            obj = DataUnit(c_i, t_i)
            datalist.append(obj)

    return datalist



################################################
################################################
################################################
def main():

    ans = 0
    datali = loading_inputs()
    ans = judging_COST(datali)
    print ans


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
N,T = map(int,input().split())
c= [list(map(int,input().split())) for i in range(N)]
s= sorted(c, key=lambda x: x[1])
print(s[0][0] if s[0][1] <= T else "TLE")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def time_limit_exceeded(N: int, T: int, CT: list) -> int:
    min_cost = float('inf')
    for c, t in CT:
        if t > T:
            continue
        if min_cost > c:
            min_cost = c
    return c


if __name__ == "__main__":
    N, T = map(int, input().split())
    CT = [tuple(int(s) for s in input().split()) for _ in range(N)]
    ans = time_limit_exceeded(N, T, CT)
    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_c = 10 ** 9
for CTi in CT:
    c, t = CTi
    if t <= T:
        ans_c = c if c < ans_c else ans_c

if ans_c == 10 ** 9:
    print('TEL')
else:
    print(ans_c)

Submission status: Wrong Answer

Solution code:
from sys import stdin
N, T = [int(x) for x in stdin.readline().rstrip().split()]
d = 1001
for i in range(N):
  l = list(map(int, input().split()))
  if l[1] <= T:
    if l[0] < d:
      d = l[0]
if d < N+1:
  print(d)
else:
  print('TLE')

Submission status: Wrong Answer

Solution code:
from sys import stdin
N, T = [int(x) for x in stdin.readline().rstrip().split()]
d = N+1
for i in range(N):
  l = list(map(int, input().split()))
  if l[1] <= T:
    if l[0] < d:
      d = l[0]
if d < N+1:
  print(d)
else:
  print('TLE')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in l:
  if int(i[1]) < t:
    print(i[0])
    exist = True
    break
if not exist:
  print("TLE")

Submission status: Wrong Answer

Solution code:
n, t = map(int, input().split())
l = [input().split() for i in range(n)]
l.sort()
for i in l:
  if int(i[1]) < t:
    print(i[0])
    break

Submission status: Wrong Answer

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

def test(lst):
    return lst[0] if lst[1]<=T else 10**4

res = min(map(test, cr_list))
if not res < 1000:
    res = 'TLE'

print(res)

Submission status: Wrong Answer

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

c_n=[]
t_n=[]
for i in range(n):
    if t[i]<=T:
        c_n.append(c[i])
        t_n.append(t[i])

if len(c_n)==0:
    print("TLE")
else:
    for i in range(len(c_n)):
        if t_n[i]==max(t_n):
            print(c_n[i])
            break

Submission status: Wrong Answer

Solution code:
N,T=map(int, input().split())
INF=10**4
mini=INF

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

Submission status: Wrong Answer

Solution code:
A, B = map(int,input().split())
cost = list()
m = B + 1
for i in range(A):
  x, y = map(int, input().split())
  if y < m:
    m = y
    cost.append(x)
print(min(cost) if m <= B else 'TLE')

Submission status: Wrong Answer

Solution code:
i=lambda:map(int,input().split());N,T=i();print(min([0]+[c for c,t in[i()for _ in[0]*N]if t<=T])or'TLE')

Submission status: Wrong Answer

Solution code:
#cording: utf-8

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

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

if len(c) != 0:
    print(min(c))
else:
    print('TEL')

Submission status: Wrong Answer

Solution code:
#cording: utf-8

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

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

c_min = 1001
for i in range(N):
    if (ct[i][1] <= T) and (ct[i][0] <= c_min):
        c_min = ct[i][0]

if c_min == 1001:
    print('TEL')
else:
    print(c_min)

Submission status: Wrong Answer

Solution code:
#cording: utf-8

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

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

if len(c) == 0:
    print('TEL')
else:
    print(min(c))

Submission status: Wrong Answer

Solution code:
#cording: utf-8

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

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

if len(c) == 0:
    print('TEL')
else:
    print(min(c))

Submission status: Wrong Answer

Solution code:
#cording: utf-8

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

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

if len(t) == 0:
    print('TEL')
else:
    print(min(c))

Submission status: Wrong Answer

Solution code:
#cording: utf-8

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

c, t = [], []
for i in range(N):
    c_tmp, t_tmp = map(int, input().split())
    if t_tmp <= T:
        c.append(c_tmp)
        t.append(t_tmp)
if len(t) == 0:
    print('TEL')
else:
    print(min(c))

Submission status: Wrong Answer

Solution code:
from operator import itemgetter

def main():
	n, t = map(int, input().split())

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

	costs = sorted(costs, key=itemgetter(0))
	if costs[0][1]>t:
		print("TLE")
		return
	for i in range(n):
		if costs[i][1] > t:
			print("TLE")
			return
		if costs[i][1] <= t:
			print(costs[i][0])
			return

main()

Submission status: Wrong Answer

Solution code:
from operator import itemgetter

def main():
	n, t = map(int, input().split())

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

	costs = sorted(costs, key=itemgetter(0))
	if costs[0][0]>t:
		print("TLE")
		return
	for i in range(n):
		if costs[i][0] > t:
			print("TLE")
			return
		if costs[i][1] <= t:
			print(costs[i][0])
			return

main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, T = [int(i) for i in input().split()]
data_ls = list()
for i in range(N):
  data_ls.append([int(i) for i in input().split()])
data_ls = [i for i in data_ls if i[1] < T]
if len(data_ls) == 0:
  print("TLE")
else:
  data_ls = sorted(data_ls, key=lambda x:x[0])
  print(data_ls[0][0])

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
ct = [None] * N
for i in range(N):
  ct[i] = list(map(int, input().split()))
ct = sorted([x[0] for x in ct if x[1] <= T]) + ['LTE']
print(ct[0])

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
ct = [None] * N
for i in range(N):
  ct[i] = list(map(int, input().split()))
ct = list(filter(lambda x: x[1] <= T, ct))
if not len(ct) > 0:
  ct.append([0, 'TLE'])
ct = sorted(ct, key=lambda x: x[0])
print(ct[0][1])

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 range(n):
  if ct[i][1] < t:
    li.append(ct[i])
  else:
    continue

if len(li) > 0:
  li2 = []
  for i in range(len(li)):
    li2.append(li[i][0])
  print(min(li2))
else:
  print("TLE")

Submission status: Wrong Answer

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

min = float("inf")
index = 0
for i,v in enumerate(e):
    if v[1] <= t:
        if v[1] <= min:
            min = v[1]
            index = v[0]
            


if min == float("inf"):
    print("TLE")
else :
    print(index)

Submission status: Wrong Answer

Solution code:
from sys import stdin

N, T, *ct = map(int, stdin.read().split())

cost = 1000
for i in range(N):
    c, t = ct[2*i:2*(i+1)]
    if t > T:
        continue
    cost = min(cost, c)

print(cost)

Submission status: Wrong Answer

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

c_t = sorted(c_t, key=lambda x:x[1])
if c_t[0][1]>T:
    print('TLE')
    import sys
    sys.exit()
ans = c_t[0][0]
for i in range(N):
    if c_t[i][1]>T:
        break
    if ans<c_t[0][0]:
        ans = c_t[0][0]
print(ans)

Submission status: Wrong Answer

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

X.sort(key=lambda x:x[1])
if X[0][1] >t:
    print('TLE')
else:
    print(X[0][0])

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
nt=[int(x) for x in input().split()]
mini=1000
try:
    for y in range(nt[0]):
        temp=([int(z) for z in input().split()])
        if(temp[1]<=nt[1] and temp[0]<mini):
            mini=temp[0]
            ans=mini
    print(ans)
except:
    print("TLE")

Submission status: Wrong Answer

Solution code:
nt=[int(x) for x in input().split()]
mini=10000000
try:
    for y in range(nt[0]):
        temp=([int(z) for z in input().split()])
        if(temp[1]<=nt[1] and temp[0]<mini):
            mini=temp[0]
    print(mini)
except:
    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)
  
min_cost = 10**5
for i in range(N):
  if t[i]<=T and min_cost>c[i]:
    min_cost=c[i]

if min_cost==10**3:
  print("TLE")
else:
  print(min_cost)

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)
  
min_cost = 10**3
for i in range(N):
  if t[i]<=T and min_cost>c[i]:
    min_cost=c[i]

if min_cost==10**3:
  print("TLE")
else:
  print(min_cost)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,T = map(int,input().split())
ans = [c for c,t in sorted([(input().split()) for i in range(N)],key=lambda x :x[1]) if int(t)<=T]
if len(ans)!=0:
    print(min(ans))
else:
    print("TLE")

Submission status: Wrong Answer

Solution code:
N,T = map(int,input().split())
ans = [c for c,t in sorted([(input().split()) for i in range(N)],key=lambda x :x[1]) if int(t)<=T]
if len(ans)!=0:
    print(ans[0])
else:
    print("TLE")

Submission status: Wrong Answer

Solution code:
N,T = map(int,input().split())
ans = [c[-1] for c,t in sorted([(input().split()) for i in range(N)],key=lambda x :x[1]) if int(t)<=T]
if len(ans)!=0:
    print(ans)
else:
    print("TLE")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,T=map(int, input().split())
ans=9999
for i in range(N):
  A,B=map(int, input().split())
  if (T>B):
    if(ans>A):
      ans=A
if(ans==9999):
  print("TLE")
else:
  print(ans)

Submission status: Wrong Answer

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

tmp_min = 10**5

for i in range(N):
    if t[i]<=T and tmp_min>c[i]:
        tmp_min = c[i]

if tmp_min > T:
    print('TLE')
else:
    print(int(tmp_min))

Submission status: Wrong Answer

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

tmp_min = 10**5

for i in range(N):
    if t[i]<=T and tmp_min>c[i]:
        tmp_min = c[i]

if tmp_min<=T:
    print(int(tmp_min))
else:
    print('TLE')

Submission status: Wrong Answer

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

tmp_min = 10**5

for i in range(N):
    if t[i]<=T and tmp_min>c[i]:
        tmp_min = c[i]

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

Submission status: Wrong Answer

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

tmp_min = 10**5

for i in range(N):
    if t[i]<T and tmp_min>c[i]:
        tmp_min = c[i]

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

Submission status: Wrong Answer

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

tmp_min = T

for i in range(N):
    if t[i]<T and tmp_min>c[i]:
        tmp_min = c[i]
    
print(tmp_min)

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
data = [list(map(int, input().split())) for _ in [0]*N]
data.sort(key=lambda x: x[0])
data = [d for d in data if d[1] <= T]
print(data[0][0] if len(data) > 1 else 'TLE')

Submission status: Wrong Answer

Solution code:
""" AtCoder """

import sys
input = sys.stdin.readline

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

Submission status: Wrong Answer

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

cost = 1001

for i in li:
    if t > i[1]:
        if cost > i[0]:
            cost = i[0]

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

Submission status: Wrong Answer

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

for i in range(n):
    c,s = map(int,input().split())
    if s <= t:
        d.append(c)
if s<=t:
    print(min(d))
else:
    print("TLE")

Submission status: Wrong Answer

Solution code:
n,t = map(int,input().split())
d = []
for i in range(n):
    c,s = map(int,input().split())
    if s<=t:
      d.append(c)  

if s<=t:
    print(min(d))
else:
    print("TLE")

Submission status: Wrong Answer

Solution code:
N,T = map(int,input().split())
ct = [list(map(int,input().split())) for _ in range(N)]
ok = False
cost = 10*10
for i in range(N):
    if ct[i][1] <= T and cost > ct[i][0]:
        cost = ct[i][0]
        ok = True
print(cost if ok 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)]
a=[]
for j in ct:
  if j[1]<t:
    a.append(j[0])
if len(a)==0:
  print("TLE")
else:
  print(min(a))

Submission status: Wrong Answer

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

minimum_cost = 1001

for sub_list in ctlist:
    if sub_list[1] <= T:
        if sub_list[0] < minimum_cost:
            minimum_cost = sub_list[0]

if minimum_cost == 1001:
    print("TLE")
print(minimum_cost)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,T=map(int,input().strip().split(" "))
c=1000
d=0

for i in range(N):
    a=input().strip().split(" ")
    a=[int(i) for i in a]
    if(a[1]<=T and a[0]<c):
        d=a[0]
        c=a[0]

if(d!=0):
    print(d)
else:
    print("TLE")

Submission status: Wrong Answer

Solution code:
n,w = map(int,input().split())
m = 1001
for i in range(n):
    a,b = map(int,input().split())
    if b <= w and a < m:
        m = a
if m == 101:
    print("TLE")
else:
    print(m)

Submission status: Wrong Answer

Solution code:
print("TLE")

Submission status: Wrong Answer

Solution code:
n,w = map(int,input().split())
m = 101
for i in range(n):
    a,b = map(int,input().split())
    if b <= w and a < m:
        m = a
if m == 101:
    print("TLE")
else:
    print(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 i<=t:m=min(m,c)
print("TLE" if m==1001 else m)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


def main():
    """Function."""
    n, t = map(int, input().split())

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

        if ti < t:
            if ci < min_val:
                min_val = ci
            else:
                pass
        else:
            pass

    print(min_val)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    n = input().split(' ')
    roads = int(n[0])
    good_time = int(n[1])
    answer = -1
    for road in range(0, roads):
        n = input().split(' ')
        cost = int(n[0])
        time = int(n[1])
        if time > good_time:
            continue
        if answer < 0 or answer > cost:
             answer = cost
    if answer < 0:
        print('TLE')
    print(str(answer))

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    n = input().split(' ')
    roads = int(n[0])
    good_time = int(n[1])
    answer = -1
    for road in range(0, roads):
        n = input().split(' ')
        cost = int(n[0])
        time = int(n[1])
        if time > good_time:
            continue
        if answer < 0 or answer > cost:
             answer = cost
    print(str(answer))

Submission status: Wrong Answer

Solution code:
import sys
lines = []
for line in sys.stdin:
  col = line.strip().split(' ')
  lines.append((int(col[0]), int(col[1])))
min = 1001
for cand in lines[1:]:
  if cand[1] < lines[0][1] and cand[0] < min:
    min = cand[0]
print(min if min < 1001 else 'TLE')

Submission status: Wrong Answer

Solution code:
import sys
lines = []
for line in sys.stdin:
  col = line.strip().split(' ')
  lines.append((int(col[0]), int(col[1])))
min = 1001
for cand in lines[1:]:
  if cand[1] < lines[0][1] and cand[0] < min:
    min = cand[1]
print(min if min < 1001 else 'TLE')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = list(map(int, input().split()))
c = 101
for i in range(a[0]):
    b = list(map(int, input().split()))
    if(c >= b[0]) and (a[1] >= b[1]):
        c = b[0]
print(c)

Submission status: Wrong Answer

Solution code:
N, T = list(map(int, input().split()))
minc = 1001;
for i in range(N):
  c, t = list(map(int, input().split()))
  if(t <= T and c < minc):
    minc = 0
if(minc == 1001):
  print("TLE")
else:
  print(minc)

Submission status: Wrong Answer

Solution code:

n, t = map(int, input().split())
costs=[]
time = []
for i in range(n):
    new_cost, new_time = map(int, input().split())
    if new_time<t:
        costs.append(new_cost)
        time.append(new_time)
    else:
        continue
if costs ==[]:
    print('TLE')
else:
    print(min(costs))

Submission status: Wrong Answer

Solution code:
def input_N_T():
    N_T=input().split()
    int_N_T=list(map(int,N_T))
    N=int_N_T[0]
    T=int_N_T[1]
    return [N,T]

N,T=input_N_T()

min_c,min_t=1001,1001

for i in range(N):
    c,t=input_N_T()
    if(t<=T and min(min_c,c)==c):
        min_c=c

if(N==1001):
    print("TLE")
    
else:
    print(min_c)

Submission status: Wrong Answer

Solution code:
def input_N_T():
    N_T=input().split()
    int_N_T=list(map(int,N_T))
    N=int_N_T[0]
    T=int_N_T[1]
    return [N,T]

N,T=input_N_T()

min_c,min_t=1001,1001

for i in range(N):
    c,t=input_N_T()
    if(t<=T and min(min_c,c)==c):
        min_c,min_t=c,t

if(N==1001 and T==1001):
    print("TLE")
    
else:
    print(c)

Submission status: Wrong Answer

Solution code:
def input_N_T():
    N_T=input().split()
    int_N_T=list(map(int,N_T))
    N=int_N_T[0]
    T=int_N_T[1]
    return [N,T]

N,T=input_N_T()

min_c,min_t=1001,1001

for i in range(N):
    c,t=input_N_T()
    if(t<=T and min(min_c,c)==c):
        min_c,min_t=c,t

print(c)

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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 and c<ans :
    ans=c
if ans>10000000000:
  ans='TLE'
else:
  print(ans)

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 and ans>c :
    ans=c
  else:
    ans=ans
if ans>10000000000:
  ans='TLE'
print(ans)

Submission status: Wrong Answer

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

C,t = [], []

for i in range(N):
    CT = list(map(int,input().split()))
    C.append(CT[0])
    t.append(CT[1])

C_min = 10000
for i,t_i in enumerate(t):
    if t_i <= T and C_min >= C[i]:
        C_min = C[i]
        
if C_min == 0:
    print('TLE')
else:
    print(C_min)

Submission status: Wrong Answer

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

C,t = [], []

for i in range(N):
    CT = list(map(int,input().split()))
    C.append(CT[0])
    t.append(CT[1])

C_min = 10000
for i,t_i in enumerate(t):
    if t_i <= T and C_min > C[i]:
        C_min = C[i]
        
if C_min == 0:
    print('TLE')
else:
    print(C_min)

Submission status: Wrong Answer

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

C,t = [], []

for i in range(N):
    CT = list(map(int,input().split()))
    C.append(CT[0])
    t.append(CT[1])

C_min = 10000
for i,t_i in enumerate(t):
    print(t_i, C[i], C_min)
    if t_i <= T and C_min > C[i]:
        C_min = C[i]
        
if C_min == 0:
    print('TLE')
else:
    print(C_min)

Submission status: Wrong Answer

Solution code:
n, tx = input().strip().split(' ')
n, tx = [int(n),int(tx)]

c_ans = 1001
for i in range (n):
    c, t = input().strip().split(' ')
    c, t = [int(c),int(t)]
    if c < c_ans and t < tx:
        c_ans = c
if c_ans == 1001:
    print('TLE')
else:
    print(c_ans)

Submission status: Wrong Answer

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

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

#print(lst)
MAX = 2^10
ans = MAX

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

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

Submission status: Wrong Answer

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

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

#print(lst)
MAX = 2^10
ans = MAX

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

if ans < MAX:
  print(ans)
else:
  print("TLE")

Submission status: Wrong Answer

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

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

print(lst)
MAX = 2^10
ans = MAX

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

if ans < MAX:
  print(ans)
else:
  print("TLE")

Submission status: Wrong Answer

Solution code:
N,T=map(int,input().split())
cto=[]
tto=[]
for i in range(N):
    t,c=map(int,input().split())
    cto.append(c)
    tto.append(t)
min=cto[0]
z=0
w=0
alu="TLE"
alv=int()
flag =False
q=0
while z < N:
    if cto[z] <= T:
        for index in range (N):
            if min > cto[index]:
                min = cto[index]
                w=index
    z=z+1
alv= tto[w]
while q < N :
    if cto[q] <= T:
        flag=True
        break
    q+=1
if flag==False:
    print(alu)
else:
    print(alv)

Submission status: Wrong Answer

Solution code:
N,T=map(int,input().split())
t_dic={}
cnt=0
for i in range(N):
    c,t=map(int,input().split())
    if t <= T:
        t_dic[t]=c
        cnt+=1
if cnt == 0:
    print('TLE')
else:
    print(min(t_dic.values()))

Submission status: Wrong Answer

Solution code:
import sys
stdin = sys.stdin

sys.setrecursionlimit(10**5)

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

n,t = li()
ct = []
for _ in range(n):
    ct.append(list(li()))
    
ans = 10**18
for ci, ti in ct:
    if ti <= t:
        ans = min(ans, ci)
        
if ans > t:
    print("TLE")
else:
    print(ans)