Problem:


Score : 200 points

Problem Statement

When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC.

You, the smartwatch, has found N routes to his home.

If Mr. X uses the i-th of these routes, he will get home in time t_i at cost c_i.

Find the smallest cost of a route that takes not longer than time T.

Constraints

All values in input are integers.

1 \leq N \leq 100

1 \leq T \leq 1000

1 \leq c_i \leq 1000

1 \leq t_i \leq 1000

The pairs (c_i, t_i) are distinct.

Input

Input is given from Standard Input in the following format:

N T
c_1 t_1
c_2 t_2
:
c_N t_N

Output

Print the smallest cost of a route that takes not longer than time T.

If there is no route that takes not longer than time T, print TLE instead.

Sample Input 1

3 70
7 60
1 80
4 50

Sample Output 1

4

The first route gets him home at cost 7.

The second route takes longer than time T = 70.

The third route gets him home at cost 4.

Thus, the cost 4 of the third route is the minimum.

Sample Input 2

4 3
1 1000
2 4
3 1000
4 500

Sample Output 2

TLE

There is no route that takes not longer than time T = 3.

Sample Input 3

5 9
25 8
5 9
4 10
1000 1000
6 1

Sample Output 3

5



Sample input:
3 70
7 60
1 80
4 50


Sample output:
4

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
c = []
t = []
for i in range(N):
    tmp = [0, 0]
    tmp[0], tmp[1] = map(int, input().split())
    c.append(tmp[0])
    t.append(tmp[1])
index = -1
cost = 1000
for i in range (N):
    if t[i] <= T and c[i] < cost:
        index = i
        cost = c[i]
if index == -1:
    print('TLE')
else:
    print(cost)

Submission status: Wrong Answer

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

time = []
cost = []

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

if T < min(time):
    print('TLE')
else:
    print(min(cost))

Submission status: Wrong Answer

Solution code:
n, t = map(int, raw_input().split())
z = 9999
for i in range(n):
	a, b = map(int, raw_input().split())
	if b <= t:
		z = min(z, a)
if z == 9999:
	print 'TLE'
else:
	print a

Submission status: Wrong Answer

Solution code:
n, t = map(int,input().split())
mydict = {}
for i in range(n):
	a, b = map(int,input().split())
	mydict.setdefault(a, b)
sortedDict = sorted(mydict.items())
k = 0
for j in sortedDict:
	k += 1
	if j[1] <= t:
		print(j[0])
		break
	if k == len(sortedDict):
		print("TLE")
		break

Submission status: Wrong Answer

Solution code:
n, t = map(int,input().split())
mydict = {}
for i in range(n):
	a, b = map(int,input().split())
	mydict.setdefault(a, b)
sortedDict = sorted(mydict.items())
k = 0
for j in sortedDict:
	k += 1
	if j[1] <= t:
		print(j[0])
		break
	if k == len(sortedDict):
		print("TLE")

Submission status: Wrong Answer

Solution code:
n, t = map(int,input().split())
mydict = {}
for i in range(n):
  a, b = map(int,input().split())
  mydict.setdefault(a, b)
sortedDict = sorted(mydict.items())
k = 0
for j in sortedDict:
  k += 1
  if j[1] <= t:
    print(j[0])
    break
  if k == len(sortedDict):
  	print("TLE")

Submission status: Wrong Answer

Solution code:
n, t = map(int,input().split())
mydict = {}
for i in range(n):
  a, b = map(int,input().split())
  mydict.setdefault(a, b)
sortedDict = sorted(mydict.items())
k = 0
for j in sortedDict:
  k += 1
  if j[1] <= t:
    print(j[1])
    break
  if k == len(sortedDict):
  	print("TLE")

Submission status: Wrong Answer

Solution code:
#読み込み。inputのところ
Ntmp,Ttmp=input().split()
N=int(Ntmp)
T=int(Ttmp)
#繰り返し読み込み・c(コスト),t(時間)
c = []
t = []
for i in range(N):
    c1,t1=[int(i) for i in input().split()]
    c.append(c1)
    t.append(t1)
#ここからTiがTより小さいものを探す。該当したら、cminに格納。そこからfor文に
cmin=-1
for i in range(N):
    if t[i]<T:
        cmin=c[i]
        
if cmin==-1:
    print("TLE")
else:
    print(cmin)

Submission status: Wrong Answer

Solution code:
#読み込み。inputのところ
Ntmp,Ttmp=input().split()
N=int(Ntmp)
T=int(Ttmp)
print("N=",N,type(N)," T=",T,type(T))
#繰り返し読み込み・c(コスト),t(時間)
c = []
t = []
for i in range(N):
    c1,t1=[int(i) for i in input().split()]
    c.append(c1)
    t.append(t1)
#ここからTiがTより小さいものを探す。該当したら、cminに格納。そこからfor文に
cmin=-1
for i in range(N):
    if t[i]<T:
        cmin=c[i]
        
if cmin==-1:
    print("TLE")
else:
    print(cmin)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
n,t = map(int,input().split())
ans_no = 0
ans_cost = t

for i in range(n):
    a,b = map(int,input().split())
    if b<ans_cost:
        ans_no = a
        ans_cost = b

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
n,t = map(int,input().split())
ans_no = 0
ans_cost = t

for i in range(n):
    a,b = map(int,input().split())
    if b<ans_cost:
        ans_no = a

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

Submission status: Wrong Answer

Solution code:
N, T = map(int, raw_input().split())
small_t = 10000
small_c = 0
for i in range(N):
  c, t = map(int, raw_input().split())
  if t <= T:
    if c < small_t:
      small_t = t
      small_c = c
if small_t > 1000:
  print('TLE')
else:
  print(small_c)

Submission status: Wrong Answer

Solution code:
import numpy as np
N, T = map(int, input().split())
costs = []
times = []
for i in np.arange(N):
    ci, ti = map(int, input().split())
    costs.append(ci)
    times.append(ti)
index = np.argmin(times)
t_min = costs[index]
if t_min < T:
    print(costs[index])
else:
    print('TLE')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,T = map(int,input().split())
c = [0]*N 
cost = 1001
for i in range(N):
    tmp_c,tmp_t = map(int,input().split())
    if tmp_t <= T:
        cost = min(tmp_c,cost)
print(cost)

Submission status: Wrong Answer

Solution code:
# -*- coding : utf-8 -*-
N, T = map(int, input().split(" "))

c = [int(1001)]

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

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

Submission status: Wrong Answer

Solution code:
# -*- coding : utf-8 -*-
N, T = map(int, input().split(" "))

c = [int(1001)]

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

tmp = min(c)

if tmp == 1001:
    print("TEL")
else:
    print(tmp)

Submission status: Wrong Answer

Solution code:
input_strs = input("")
input_NT = input_strs.split(" ")
N = int(input_NT[0])
if N  <= 0 or N > 100:
    exit()
T = int(input_NT[1])
if T <= 0 or T > 1000:
    exit()
i = 1
min_i= 0
min_t = None
for i in range(N):
    costs = input("")
    cost = costs.split(" ")
    ci = int(cost[0])
    if ci <= 0 or ci >1000:
        exit()
    ti= int(cost[1])
    if ti <=0 or ti > 1000:
        exit()
    if T > ti and min_i > ci:
        min_i = ci
if min_t is None:
    print("TLE")
else:
    print(min_i)

Submission status: Wrong Answer

Solution code:
input_strs = input("")
input_NT = input_strs.split(" ")
N = int(input_NT[0])
if N  <= 0 or N > 100:
    exit()
T = int(input_NT[1])
if T <= 0 or T > 1000:
    exit()
i = 1
min_i= 0
min_t= T
for i in range(N):
    costs = input("")
    cost = costs.split(" ")
    ci = int(cost[0])
    if ci <= 0 or ci >1000:
        exit()
    ti= int(cost[1])
    if ti <=0 or ti > 1000:
        exit()
    if T > int(cost[1]):
        min_t = int(cost[1])
        min_i = i
if min_t == T:
    print("TLE")
else:
    print(min_i)

Submission status: Wrong Answer

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

a =[]
for i in range(n):
    if li[i][1] <= t:
        a.append(i)
print(a)
b = []
for i in a:
    b.append(li[i][0])
print(b)
if b:
    print(min(b))
else:
    print("TLE")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N, T = map(int,input().split())
mincost = 1000
for i in range(N):
    ci, ti = map(int,input().split())
    if ti <= T:
            mincost = min(mincost,ci)

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

Submission status: Wrong Answer

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

ct = [list(map(int, input().split())) for i in range(N)]
minnum = 9999
for c, t in ct:
    if t <= T:
        if minnum >= c:
            minnum = c

print(minnum if minnum != 999 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)]
minnum = 9999999
for c, t in ct:
    if t <= T:
        if minnum >= c:
            minnum = c

print(minnum if minnum != 999 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)]
minnum = 999
for c, t in ct:
    if t <= T:
        if minnum >= c:
            minnum = c

print(minnum if minnum != 999 else 'TLE')

Submission status: Wrong Answer

Solution code:
N,T=map(int,input().split())
root=[tuple(map(int,input().split())) for i in range(N)]
     
minc=1000
for cand in root:
    if cand[1]<=T:
        if cand[0]<minc:
            minc=cand[0]
if minc==1000:
    print("TLE")
else:
    print(minc)

Submission status: Wrong Answer

Solution code:
N, T = map(int, input().split())
x = [list(map(int, input().split())) for _ in range(N)]
x.sort(key=lambda y:y[0], reverse=True)
ans = 0
for (c, t) in x:
    if t <= T:
        ans = c
print(ans)

Submission status: Wrong Answer

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

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**13
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-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 pf(s): return print(s, flush=True)


def main():
    n,t = LI()
    a = [LI() for _ in range(n)]
    r = inf
    for c, d in a:
        if d > t:
            continue
        if r > c:
            r = c
    if r == inf:
        return -1

    return r


print(main())

Submission status: Wrong Answer

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

minC = 1001
for i in range(n):
  c, t = list(map(int, input().split()))
  if t >= tt:
    continue
  
  minC = min(minC, c)

print(minC)

Submission status: Wrong Answer

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

minC = 1001
for i in range(n):
  c, t = list(map(int, input().split()))
  if t > tt:
    continue
  
  minC = min(minC, c)

print(minC)

Submission status: Wrong Answer

Solution code:
route_num, limit = map(int, input().split(' '))

costs = []
spends = []
for i in range(route_num):
    cost, spend = map(int, input().split(' '))
    costs.append(cost)
    spends.append(spend)

max_cost = 2000
for cost, spend in zip(costs, spends):
    if spend <= limit and cost < max_cost:
        min_cost = cost

if max_cost == 2000:
    print("TLE")
else:
    print(max_cost)

Submission status: Wrong Answer

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

	costs = []
	if limit >= t:
		costs.append(c)

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

Submission status: Wrong Answer

Solution code:
[N, T] = [int(i) for i in input().split()]
cmin = 1001
for i in range(N):
    [c, t] = [int(i) for i in input().split()]
    if t <= T and c <= cmin:
        cmin = c
if cmin == 1001:
    print('TLE')
else:
    print(c)

Submission status: Wrong Answer

Solution code:
N, T = list(map(int, input().split(" ")))
c = []
t = []

for i in range(N):
    ci, ti = input().split(" ")
    c.append(int(ci))
    t.append(int(ti))
if min(t) > T:
    print("TLE\n")

else:
    cost = 10000
    for i in range(N):
        if cost > c[i] and T > t[i]:
            cost = c[i]
    print(cost)

Submission status: Wrong Answer

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

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

if ans == 1234567:
    print("LTE")
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
num, time = map(int, input().split(' '))
# print(num, time)

columns = []
able_columns = []
my_dict = {}


for i in range(num):
    columns = (list(map(int,input().rstrip().split(' '))))
    if columns[1] < time:
        able_columns.append(columns)

if able_columns == []:
    print('TLE')

# print(able_columns)
# print(min(able_columns[0]))

else:
    for i in able_columns:
        my_dict[i[0]] = i[1]
    print(min(my_dict))

Submission status: Wrong Answer

Solution code:
num, time = map(int, input().split(' '))
# print(num, time)

columns = []
able_columns = []
my_dict = {}


for i in range(num):
    columns = (list(map(int,input().rstrip().split(' '))))
    columns.append(i+1)
    if columns[1] < time:
        able_columns.append(columns)

if able_columns == []:
    print('TLE')

# print(able_columns)
# print(min(able_columns[0]))

else:
    for i in able_columns:
        my_dict[i[0]] = i[2]
    
    min_cost = min(my_dict)
    min_cost_num = my_dict[min_cost]
    print(min_cost_num)

Submission status: Wrong Answer

Solution code:
n, t = map(int, input().split())
list = [[i] for i in range(n)]
k = 0
list= [0, 0]
for j in range(n):
    a, b = input().strip().split(' ')
    if int(b) > t:
        pass
    else:
        k += 1
        if int(a) < list[0]:
            list = [int(a),int(b)]
        else:
            pass
if k == 0:
    print('TLE')
else:
    print(list[0])

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:
    if c < ans:
        ans = c
print(ans)

Submission status: Wrong Answer

Solution code:
n = list(map(int, input().strip().split(' ')))
b = n[1]
h = 100000
c = 100000
int(c)
a = []
for i in range(n[0]):
  a.append(list(map(int, input().split())))
  if a[i][1] <= n[1] and a[i][0] <= c:
    h = a[i][1]
    c = a[i][0]
    

print(h)
print(c)
if h < n[1]:
  print(c)
else:
    print("TLE")

Submission status: Wrong Answer

Solution code:
N,T = map(int, input().split())
minC = 1001
flag = False
for i in range(int(N)):
    c, t = map(int, input().split())
    if int(T) >= t and minC >= c:
        minC = c
        frag = True

if(flag == False):
    print("TLE")
else:
    print(minC)

Submission status: Wrong Answer

Solution code:
n,t=[int(s)for s in input().split()]
cost=[]
for _ in range(n):
  c,ti=[int(s)for s in input().split()]
  if ti<t:cost.append(c)
if len(cost)==0:print("TLE")
else:
  cs=sorted(cost)
  print(cs[0])

Submission status: Wrong Answer

Solution code:
N,T = map(int, input().split())
minC = 1001
flag = False
for i in range(int(N)):
    c, t = map(int, input().split())
    if int(T) > t and minC > c:
        minC = c
        frag = True

if(flag == False):
    print("TLE")
else:
    print(minC)

Submission status: Wrong Answer

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


cost = 10000
res = [0,0]

for i in range(n[0]):
    get = input().split(" ")
    get = list(map(int,get))
    
    if get[1] <= n[1]:
        res[1] = get[1]
        if get[0] < cost:
            cost = get[0]


if res[0]==0 and cost==0:
    print('TLE')
else:print(cost)

Submission status: Wrong Answer

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

print(minC)

Submission status: Wrong Answer

Solution code:
n = input().split(" ")
n = list(map(int,n))
#print(n)


cost = 10000000000000
res = [0,0]

for i in range(n[0]):
    get = input().split(" ")
    get = list(map(int,get))
    
    if get[1] <= n[1]:
        res[1] = get[1]
        if get[0] < cost:
            cost = get[0]


if res[0]==0 and cost==0:
    print('TLE')
else:print(cost)

Submission status: Wrong Answer

Solution code:
import sys
N, T = map(int, sys.stdin.readline().split(" "))
roots = [tuple(map(int, sys.stdin.readline().split(" "))) for i in range(N)]

from operator import itemgetter
#roots = sorted(roots, key=lambda x:x[1])
roots = (sorted(roots, key=itemgetter(1, 0)))

def dfs(i, csum, tsum):
    if tsum + roots[i][1] <= T:
        if i+1 == N:
          return csum
        else:
          return dfs(i+1, csum+roots[i][0], tsum+roots[i][1])
    else:
        return 100000000 if csum == 0 else csum

ans = 100000000
for ii in range(N):
  csum = dfs(ii, 0, 0)
  if ans > csum:
    ans = csum
  if csum == 100000000:
    is_do = False
    break

if ans == 100000000:
    print('TLE')
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
A=[]
while True:
    try:
        A.append(list(map(int,input().split())))
              
 
    except:
        break;
#2列めがT以下で且つ、コストが最小なものを抽出
T = A[0][1]
Tc = 0
min = A[1][1] #最小を7とす
 
for i in range(1, len(A)):
  j = int(i)
  if A[j][1] <= T:
    Tc = Tc+1
    if A[j][0] <= min:
      min = A[j][0]
     
      
if Tc == 0:
  print("TLE")
else:
  print(min)

Submission status: Wrong Answer

Solution code:
a=[]
b=1000
n,t=map(int,input().split(" "))
for _ in range(n):
    a.append(tuple(map(int,input().split(" "))))
for i in range(n):
    if t>a[i][1]:
        if b>a[i][0]:
            b=a[i][0]
if b !=1000:
    print(b)
else:
    print("TLE")

Submission status: Wrong Answer

Solution code:
A=[]
while True:
    try:
        A.append(list(map(int,input().split())))
              

    except:
        break;
#2列めがT以下で且つ、コストが最小なものを抽出
min = A[1][1] #最小を7とす

for i in range(1, len(A)):
  j = int(i)
  if A[j][1] < A[0][1]:
    if A[j][0] < min:
      min = A[j][0]

if min < A[0][1]:
  print(min)
else:
  print("TLE")

Submission status: Wrong Answer

Solution code:
A=[]
while True:
    try:
        A.append(list(map(int,input().split())))
              

    except:
        break;
#2列めがT以下で且つ、コストが最小なものを抽出
min = A[1][1] #最小を7とす

for i in range(1, len(A)):
  j = int(i)
  if A[j][1] <= A[0][1]:
    if A[j][0] <= min:
      min = A[j][0]

if min > A[0][1]:
  print("TLE")
else:
  print(min)

Submission status: Wrong Answer

Solution code:
import sys
N,T =map(int,input().split())
c=[]
t=[]
t_count=0
for i in range(N):
    c_n,t_n=map(int,input().split())
    if t_n>T:
        t_count+=1
    if t_n<=T:
        c.append(c_n)
        t.append(t_n)
        if i>len(t):
            break
        
    

if t_count==N:
    print("TLE")
    sys.exit()

print(min(c))

Submission status: Wrong Answer

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

def main():
	N, T = map(int,input().split())
	c_list = []
	t_list = []
	for i in range(N):
		c, t = map(int,input().split())
		c_list.append(c)
		t_list.append(t)
	
	#print(t_list)
	#print(type(t_list[0]))
	index_list = []
	for i in range(len(t_list)):
		if t_list[i] < T:
			index_list.append(i)
	
	#print(index_list)
	
	if len(index_list) == 0:
		return print("TLE")

	cost_min = float("inf")
	for i in index_list:
		if c_list[i] < cost_min:
			cost_min = c_list[i]
	
	print(int(cost_min))
	

if __name__ == "__main__":
	main()

Submission status: Wrong Answer

Solution code:
n = list(map(int, input().strip().split(' ')))
b = n[1]
c = "TLE"
a = []
for i in range(n[0]):
  a.append(list(map(int, input().split())))
  if a[i][1] < b:
    b = a[i][1]
    c = a[i][0]
print(c)

Submission status: Wrong Answer

Solution code:
import numpy as np

dataNum, timeMax = input().strip().split(' ')
dataNum, timeMax = [int(dataNum), int(timeMax)]

cost = []
time = []

for i in range(dataNum):
    A, B = list(map(int, input().strip().split(' ')))
    cost.append(A)
    time.append(B)

if min(time) > timeMax:
    print('TLE')
else :
    print(min(cost))

Submission status: Wrong Answer

Solution code:
import numpy as np

N, T = input().split()
N = int(N)
T = int(T)
c = np.zeros(N)
t = np.zeros(N)
for i in range(N):
    cc, tt = input().split()
    c[i] = int(cc)
    t[i] = int(tt)
if (t < T).sum() > 0:
    n = np.min(c[t < T])
    print(int(n))
else:
    print("TLE")

Submission status: Wrong Answer

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

def main():
	N, T = map(int,input().split())
	c_list = []
	t_list = []
	for i in range(N):
		c, t = map(int,input().split())
		c_list.append(c)
		t_list.append(t)
	
	index_list = []
	for i in range(N):
		if t_list[i] < T:
			index_list.append(i)
	
	#print(index_list)
	
	if len(index_list) == 0:
		return print("TLE")

	cost_min = float("inf")
	for i in range(len(index_list)):
		if c_list[i] < cost_min:
			cost_min = c_list[i]
	
	print(int(cost_min))
	

if __name__ == "__main__":
	main()

Submission status: Wrong Answer

Solution code:
import numpy as np

dataNum, timeMax = input().strip().split(' ')
dataNum, timeMax = [int(dataNum), int(timeMax)]

cost = []
time = []

for i in range(dataNum):
    A, B = list(map(int, input().strip().split(' ')))
    cost.append(A)
    time.append(B)

if min(time) > timeMax:
    print('TLE')
else :
    print(cost[np.argmin(time)])

Submission status: Wrong Answer

Solution code:
N,T=map(int,input().split())
flag=1001
for _ in range(N):
    c,t=map(int,input().split())
    if t>T:
        continue
    else:
        count=c
        if count<=flag:
            flag=count
print(c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,t = map(int,input().split())
lis = [list(map(int, input().split())) for _ in range(n)]
minCost = float("inf")
for i in lis:
    if i[1] <= t:
        if i[0] < minCost:
            minCost = i[0]
print(minCost)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
    N,T= (int(i) for i in input().split())
    a_min=1000

    for i in range(N):
        ai,bi= (int(j) for j in input().split())  
        if bi<= T:
            if ai <= a_min:
                a_min = ai

    if a_min==1000:
        print("TLE")
    else:
        print(a_min)
          
     
main()

Submission status: Wrong Answer

Solution code:
n,t = map(int,input().split())
lis = [list(map(int, input().split())) for _ in range(n)]
minCost = float("inf")
for i in lis:
    if i[1] < t:
        if i[0] < minCost:
            minCost = i[0]
print(minCost)

Submission status: Wrong Answer

Solution code:
#

array = list(map(int, input().strip().split(' ')))


N =  array[0]

T =  array[1]


#print(N)
#print(T)

if N < 1:
    sys.exit()

if N > 100:
    sys.exit()


if T < 1:
    sys.exit()

if T > 1000:
    sys.exit()



c_min = 9999


for i in range(N):
    array1 = list(map(int, input().strip().split(' ')))
    cN =  array1[0]

    tN =  array1[1]

    if cN < 1:
        sys.exit()

    if cN > 1000:
        sys.exit()

    if tN < 1:
        sys.exit()

    if tN > 1000:
        sys.exit()
    
    if tN <= T:
        if c_min > cN:

            c_min = cN

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

else:
    print(c_min)

Submission status: Wrong Answer

Solution code:
n, T = map(int, input().split())
a = set()
min_ = 1000
for i in range(n):
    c, t = map(int, input().split())
    a.add(c)
    if t <= T and c < min_:
        min_ = c
    a.remove(c)
if min_ == 1000:
    print('TLE')
else:
    print(min_)

Submission status: Wrong Answer

Solution code:
N, T =(int(x) for x in input().split())
for i in range(N):
    c, t =(int(z) for z in input().split())
    if i == 0:
        a = t
        b = c
    if a > t:
        if t <= T:
            b = c
            a = t
    else:
        pass
if a > T:
    print('TLE')
else:
    print(b)

Submission status: Wrong Answer

Solution code:
def main():
    N,T= (int(i) for i in input().split())
    a_min=1000

    for i in range(N):
        ai,bi= (int(j) for j in input().split())  
        if bi<= T:
            if ai <= a_min:
                a_min = ai

    if ai==1000:
        print("TLE")
    else:
        print(a_min)
          
     
main()

Submission status: Wrong Answer

Solution code:

N,T=input().split(' ')
N=int(N)
T=int(T)
a=list()
for i in range(N):
    c,t=input().split(' ')
    c=int(c)
    t=int(t)
    a.append((c,t))

minValue=0x3FF
print(minValue)
for it in a:
    if it[1]>T:
        continue
    if it[0]<minValue:
        minValue=it[0]
if(minValue==0x3FF):
    print("TLE")
else:
    print(minValue)

Submission status: Wrong Answer

Solution code:
from operator import itemgetter

N, T=map(int, input().split())
Ns=[]
A=[]
for i in range(N):
    Ns.append(list(map(int, input().split())))
Ns.sort(key=itemgetter(1))
for i in range(N):
    if Ns[i][1]<=T:
        A.append(Ns[i])
if len(A)==0:
    print('TEL')
else:
    print(A[0][0])

Submission status: Wrong Answer

Solution code:
nt = input().split()
ct = [0]
for i in range(int(nt[0])):
    inp = input().split()
    if int(inp[1]) <= int(nt[1]):
        ct.append(int(inp[0]))
print(ct)
ct.sort()
print(ct)
if len(ct) == 1:
    print("TLE")
else:
    print(ct[1])

Submission status: Wrong Answer

Solution code:
#

array = list(map(int, input().strip().split(' ')))


N =  array[0]

T =  array[1]


print(N)
print(T)

if N < 1:
    quit()

if N > 100:
    quit()


if T < 1:
    quit()

if T > 1000:
    quit()


print(N)
print(T)

c_min = 9999


for i in range(N):
    array1 = list(map(int, input().strip().split(' ')))
    cN =  array1[0]

    tN =  array1[1]

    if cN < 1:
        quit()

    if cN > 1000:
        quit()

    if tN < 1:
        quit()

    if tN > 1000:
        quit()

    if tN <= T:
        if c_min > cN:

            c_min = cN

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

else:
    print(c_min)

Submission status: Wrong Answer

Solution code:
import sys
N,T =map(int,input().split())
c=[]
t=[]
t_count=0
for i in range(N):
    c_n,t_n=map(int,input().split())
    c.append(c_n)
    t.append(t_n)
    if t[i]>=T:
        t_count += 1
    

if t_count==N:
    print("TLE")
    sys.exit()

ans_i=0 
for (i,x) in enumerate(t):
    if i>=1:
        if t[i]<t[i-1]:
            ans_i=i
            ans_t=t[i]
            
print(c[ans_i])

Submission status: Wrong Answer

Solution code:
from operator import itemgetter

N, T=map(int, input().split())
Ns=[]
A=[]
for i in range(N):
    Ns.append(list(map(int, input().split())))
Ns.sort(key=itemgetter(1))
for i in range(N):
    if Ns[i][1]<=T:
        A.append(Ns[i])
if len(A)==0:
    print('TEL')
else:
    A.sort(key=itemgetter(0))
    print(A[0][0])

Submission status: Wrong Answer

Solution code:
import sys
a=input()
c=a.split(" ")
c[0]=int(c[0])
c[1]=int(c[1])
b=[input().split(" ") for x in range(c[0])]

for i in range(len(b)):
    for x in range(2):
        b[i][x]=int(b[i][x])



b.sort(key=lambda x:x[1])


if c[1] < b[0][1]:
    print("TLE")
    sys.exit()

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

mini=10000000000
for i in range(len(b)):
    if b[i][1] < c[1]:
        if b[i][0] < mini:
            
            mini=i
print(b[mini][0])

Submission status: Wrong Answer

Solution code:
import numpy as np
NT=list(map(int,input().split()))
N=NT[0]
T=NT[1]
nlist=[]
tlist=[]
for i in range(N):
    listA=list(map(int,input().split()))
    nlist.append(listA[0])
    tlist.append(listA[1])
#indexes = [i for i, x in enumerate(tlist) if x <= T]
npnlist=np.array(nlist)
nptlist=np.array(tlist)
where=np.where(nptlist<=T)
if(where[0]!=[]):
    minmum=100000
    for i in range(len(where[0])):
        if(npnlist[where[0][i]]<minmum):
            minmum=npnlist[where[0][i]]
    print(minmum)
else:
    print("TLE")

Submission status: Wrong Answer

Solution code:
N,T=map(int, input().split())
ct=[]
Nminimum=int(101)
output=str('TLE')
for i in range(N):
    ct.append(list(map(int, input().split())))
for i in range(N):
    if ct[i][1]<=T:
        if ct[i][0]<Nminimum:
            Nminimum=ct[i][0]
            output=Nminimum
print(output)

Submission status: Wrong Answer

Solution code:
def main():
    N,T= (int(i) for i in input().split())
    A=[]
    B=[]
    
    for i in range(N):
        ai,bi= (int(j) for j in input().split())  
        A.append(ai)
        B.append(bi)

    if (min(B)) <= T:
        print(min(A))
    else:
        print("TLE")
     
main()

Submission status: Wrong Answer

Solution code:
nt = input().split()
ct = ["0"]
for i in range(int(nt[0])):
    inp = input().split()
    if int(inp[1]) <= int(nt[1]):
        ct.append(inp[0])
print(ct)
ct.sort()
print(ct)
if len(ct) == 1:
    print("TLE")
else:
    print(ct[1])

Submission status: Wrong Answer

Solution code:
nt = input().split()
ct = ["0"]
for i in range(int(nt[0])):
    inp = input().split()
    if int(inp[1]) <= int(nt[1]):
        ct.extend(inp[0])
print(ct)
ct.sort()
print(ct)
if len(ct) == 1:
    print("TLE")
else:
    print(ct[1])

Submission status: Wrong Answer

Solution code:
ans1 = 1000
ans2 = 1000
ans_f = 0
a,b = map(int,input().split())
for i in range(a):
    c,d = map(int,input().split())
    if d <= b:
        ans_f = 1
        if d < ans2:
            ans1 = c
            ans2 = d
if ans_f == 1:
    print(ans1)
else:
    print('TLE')

Submission status: Wrong Answer

Solution code:
n, T = map(int, input().split())
a = set()
min_ = 1000
for i in range(n):
    c, t = map(int, input().split())
    a.add(c)
    if t <= T and c <= min_:
        min_ = c
    a.remove(c)
if min_ == 1000:
    print('TLE')
else:
    print(min_)

Submission status: Wrong Answer

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

x = [[int(i) for i in input().split()] for i in range(N)]

m = x[0][0]
t = x[0][1]

for i in range(N):
	if x[i][1]<T+1:
		m = min(m,x[i][0])
	t = x[i][1]
if t<T+1:
	print(m)
else:
	print("TLE")

Submission status: Wrong Answer

Solution code:
import numpy as np

dat0 = input().split()
N = int(dat0[0])
T = int(dat0[1])

dat1 = [input().split() for i in range(N)]

dat = np.array(dat1)
dat = dat.astype(np.int64)



lt_T = dat.T[1] < T

ans = dat.T[0][lt_T]

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

Submission status: Wrong Answer

Solution code:
n,t=map(int,input().split())
result=1001
for i in range(n):
    ci,ti=map(int,input().split())
    if ti > t:
        pass
    else:
        result=min(result,ci)
if result==t+1:
    print('TLE')
else:
    print(result)

Submission status: Wrong Answer

Solution code:
N,T = map(int, input().split())
cost = [-1] * N

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

for j in range(N):
    if min > cost[j] and cost[j] != -1:
        min = cost[j]
        
if min != -1:
    print(min)
else:
    print("TLE")