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: Accepted

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

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

        if c > cost:
            c = cost

if c is None:
    print('TLE')
else:
    print(c)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(N):
  c1, t1 = map(int,input().split())
  c.append(c1)
  t.append(t1)
  
ans = []

for i in range(N):
  if t[i] <= T:
    ans.append(c[i])

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

Submission status: Accepted

Solution code:
n,t = map(int, input().split())
anslist = []
for i in range(n):
  cost,time = map(int, input().split())
  if time <= t:
    anslist.append(cost)
  else:
    continue
if not anslist:
  print("TLE")
else:
  print(min(anslist))

Submission status: Accepted

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

ans=10000
for i in c:
    if i[1] <= t and i[0] < ans:
        ans = i[0]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if mintime == 10**9:
    print("TLE")
else:
    print(mintime)

Submission status: Accepted

Solution code:
c, t = [int(x) for x in input().split()]
cost = 1001
try:
  while 1:
    path = [int(x) for x in input().split()]
    if path[1] > t:
      continue
    else:
      if path[0] < cost:
        cost = path[0]
except EOFError:
  if cost != 1001:
    print(cost)
  else:
    print('TLE')

Submission status: Accepted

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

for i in range(n):
	cost,time = [int(x) for x in input().split()]
	costs.append(cost)
	if time<=t: timeIndices.append(i)

mincostIndex=0
for i in timeIndices:
	if costs[i] < costs[mincostIndex]:
		mincostIndex=i

if (timeIndices): print(costs[mincostIndex])
else: print("TLE")

Submission status: Accepted

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

Submission status: Accepted

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

c = []
t = []

for _ in range(n):
	a, b = map(int, input().split())
	if b <= T:
		c.append(a)
		t.append(b)

print(min(c)) if any(c) else print("TLE")

Submission status: Accepted

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

ans = 1000000007
for i in range(N):
    if ct[i][1] <= T:
        ans = min(ans, ct[i][0])

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

Submission status: Accepted

Solution code:
n,t=map(int,input().split())
d=[]
for i in range(n):
  x,y=map(int,input().split())
  if t >= y:
    d.append([x,y])
if len(d)>0:
  d.sort()
  print(d[0][0])
else:
  print("TLE")

Submission status: Accepted

Solution code:
N , T = map(int,input().split())
roots = [list(map(int,input().split())) for _ in range(N)]
min_cost = float("inf")
ans = "TLE"
for key , val in enumerate(roots):
    if val[0] < min_cost and val[1] <= T:
        min_cost = val[0]
        ans = val[0]
print(ans)

Submission status: Accepted

Solution code:
n, t = map(int, input().split())
candt = []
for _ in range(n) :
    candt += [list(map(int, input().split()))]
candidate = []
for i in range(n) :
    if candt[i][1] <= t :
        candidate += [candt[i]]

if candidate == [] :
    print("TLE")
else :
    costlist = [i[0] for i in candidate]
    print(min(costlist))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC 112: B – Time Limit Exceede
n, t = [int(s) for s in input().split()]

c = []

for i in range(n):

    tmp = [int(s) for s in input().split()]

    if tmp[1] <= t:
        c.append(tmp[0])

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

Submission status: Accepted

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

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, T = map(int, input().split())
ct = [tuple(map(int, input().split())) for _ in range(N)]
min_cost = 10**9 + 7
for c, t in ct:
    if t <= T:
        min_cost = min(min_cost, c)
print("TLE" if min_cost == 10**9 + 7 else min_cost)

Submission status: Accepted

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


def solve(N: int, T: int, c: "List[int]", t: "List[int]"):
    if min(t) > T:
        print("TLE")
    else:
        ans = max(c)
        for i in range(N):
            if t[i] <= T:
                ans = min(ans, c[i])
        print(ans)


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    T = int(next(tokens))  # type: int
    c = [int()] * (N)  # type: "List[int]"
    t = [int()] * (N)  # type: "List[int]"
    for i in range(N):
        c[i] = int(next(tokens))
        t[i] = int(next(tokens))
    solve(N, T, c, t)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 2019-11-10 20:23:41(JST)
import sys
# import collections
# import math
# from string import ascii_lowercase, ascii_uppercase, digits
# from bisect import bisect_left as bi_l, bisect_right as bi_r
# import itertools
# from functools import reduce
# import operator as op
# from scipy.misc import comb # float
# import numpy as np 

def main():
    N, T = (int(x) for x in sys.stdin.readline().split())

    ct = []
    for i in range(N):
        c, t = (int(x) for x in sys.stdin.readline().split())
        if t <= T:
            ct.append((c, t))
    
    ct.sort()
    print(ct[0][0] if ct else 'TLE')


if __name__ == "__main__":
    main()

Submission status: Accepted

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

res = 10**12
flag = False
for _ in range(N):
    c, t = map(int, input().split())
    if t > T:
        continue
    flag = True
    res = min(c, res)

if flag:
    print(res)
else:
    print("TLE")

Submission status: Accepted

Solution code:
from sys import stdin
import bisect

n,t = [int(x) for x in stdin.readline().rstrip().split()]
li = [list(map(int,stdin.readline().rstrip().split())) for _ in range(n)]
li2 = []
for i in range(n):
    if li[i][1] <= t:
        li2.append(li[i][0])
if len(li2) == 0:
    print("TLE")
    exit()
li2.sort()
print(li2[0])

Submission status: Accepted

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

def main():
    N,T=map(int,input().split())
    cc=[]
    for _ in range(N):
        c,t=map(int,input().split())
        if t <= T:
            cc.append(c)
    if cc:
        print(min(cc))
    else:
        print('TLE')

main()

Submission status: Accepted

Solution code:
n,t = list(map(int,input().split()))
 
minc = -1
for i in range(n):
  ci,ti = list(map(int,input().split()))
  if ti <= t:
    if minc == -1:
      minc = ci
    else:
      minc = min(minc,ci)
 
if minc == -1:
  print("TLE")
else:
  print(minc)

Submission status: Accepted

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


print(ans)

Submission status: Accepted

Solution code:
firstLine = list(map(int, input().split()))
costs = []

for i in range(firstLine[0]):
    line = list(map(int, input().split()))
    if line[1]> firstLine[1]:
        continue
    else:
        costs.append(line[0])

if len(costs)>0:
    print(sorted(costs)[0])
else:
    print("TLE")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import numpy as np
N, T = map(int, input().split())
c = np.zeros(N, dtype=int)
t = np.zeros(N)
for i in range(N):
  c[i], t[i] = map(int, input().split())

cc = c[t<=T]
if(len(cc) == 0):
  print('TLE')
else:
  print(min(cc))

Submission status: Accepted

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

minc = -1
for i in range(n):
  ci,ti = list(map(int,input().split()))
  if ti <= t:
    if minc == -1:
      minc = ci
    else:
      minc = min(minc,ci)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def MRX():
    N,T = input().split()
    N,T= int(N),int(T)
    travel = {}
    for i in range(N):
        c , t = input().split()
        travel[int(c)] = int(t)
    for j in sorted(travel):
        if travel[j] <= T:
            return j
    return "TLE"



print(MRX())

Submission status: Accepted

Solution code:
def mrx():
    N,T = input().split()
    N,T= int(N),int(T)
    travel = {}
    for i in range(N):
        c , t = input().split()
        travel[int(c)] = int(t)
    for j in sorted(travel):
        if travel[j] <= T:
            return j
    return "TLE"



print(mrx())

Submission status: Accepted

Solution code:
N, T = map(int, input().split())
ans = float("inf")

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

Submission status: Accepted

Solution code:
n,t=map(int,input().split())
c=[0]*n
T=[0]*n
count=1000000
ans=0
for i in range(n):
    c[i],T[i]=map(int,input().split())
if min(T)>t:
    print('TLE')
else:
    for j in range(n):
        if T[j]<=t:
            if c[j]<count:
                count=c[j]
                ans=c[j]
    print(ans)

Submission status: Accepted

Solution code:
n, t = map(int, input().split())
cost = 1e9
for i in range(n):
    cn, tn = map(int, input().split())
    if tn <= t and cost > cn:
        cost = cn
if cost == 1e9:
    print('TLE')
else:
    print(cost)

Submission status: Accepted

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

Submission status: Accepted

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

C = []

for _ in range(N):
  c,t = map(int,input().split())
  if t <= T:
    L = [c,t]
    C.append(L)
    
C = sorted(C,key = lambda x:x[0])

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

for n in range(N):
    temp = []
    c, t = map(int, input().split())
    temp += [c,t]
    C_T.append(temp)

C_can = []

for n in range(N):
    if C_T[n][1] <= T:
        C_can.append(C_T[n][0])

if len(C_can) == 0:
    print('TLE')
else:
    print(int(min(C_can)))

Submission status: Accepted

Solution code:
N, T = [int(x) for x in input().split()]
lst = []
for i in range(N):
    c, t = [int(x) for x in input().split()]
    if (t <= T): lst.append(c)
if (len(lst)):
    lst.sort()
    print(lst[0])
else:
    print('TLE')

Submission status: Accepted

Solution code:

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

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

min_cost = 10000

for ct in ct_list:
    if ct[1] <= T and ct[0] < min_cost:
        min_cost = ct[0]

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

Submission status: Accepted

Solution code:
a = list(map(int,input().split()))
N=a[0]
T=a[1]
tmp=[]
ct = [list(map(int,input().split())) for l in range(N)]
for i in range(N):
    if ct[i][1]<=T:
        tmp.append(ct[i][0])

tmp.sort()

if len(tmp)==0:
    print('TLE')
else:
    print(tmp[0])

Submission status: Accepted

Solution code:

N,T=[int(x) for x in input().split()]
COST=[]

for i in range(N):
    c,t=[int(x) for x in input().split()]
    if t <= T:
        COST += [c]

if COST!=[]:
    print(min(COST))
else:
    print('TLE')

Submission status: Accepted

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

Submission status: Accepted

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

a=[]
for i in range(n):
    c,t=map(int,input().split())
    if T>=t:
        a.append(c)

if len(a)==0:
    print('TLE')
else:
    print(min(a))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

select_list = []
for i in range(N):
    if t_list[i] > T:
        pass
    else:
        select_list.append(c_list[i])

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

Submission status: Accepted

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)

ans = 1e5
for i in range(N):
	if t[i] <= T:
		ans = min(ans, c[i])
if (ans == 1e5) : print("TLE")
else : print(ans)

Submission status: Accepted

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

ret = float('inf')
for c, t in ct :
    if t <= T :
        ret = min(ret, c)

if ret == float('inf') :
    print('TLE')
else :
    print(ret)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

    print(cost)


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

    main(n, t, c_t)

Submission status: Accepted

Solution code:
n, t = map(int, input().split())
c_list = []
for i in range(n):
    c_i, t_i = map(int, input().split())
    if t_i <= t:
        c_list.append(c_i)
if len(c_list) == 0: print("TLE")
else: print(min(c_list))

Submission status: Accepted

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: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,T=map(int,input().split())
cmin = None
for i in range(N):
    c,t=map(int,input().split())
    if t > T :
        pass
    else :
        if not cmin :
            cmin = c
        elif c < cmin :
            cmin = c
    

if not cmin :
    print("TLE")
else:
    print(cmin)

Submission status: Accepted

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

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

Submission status: Accepted

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

N, T = list(map(int, input().split()))
ct_list = []

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

min_c = float("inf")

for ct in ct_list:
    c, t = ct
    if t <= T:
        min_c = min(c, min_c)

ans = min_c if min_c != float("inf") else "TLE"
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

# print(Array)

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

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

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

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

Submission status: Accepted

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 ans==[]: print('TLE')
else: print(min(ans))

Submission status: Accepted

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: Accepted

Solution code:
import sys

#+++++

def gg():
	a,b=map(int, input().split())
	return (a,b)


def main():
	n,t = map(int, input().split())
	al=[gg() for _ in range(n)]
	cc = [x[0] for x in al if x[1] <= t]
	if len(cc)==0:
		ans='TLE'
	else:
		ans=min(cc)
	print(ans)
	return
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)

if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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: Accepted

Solution code:
N, T = [int(s) for s in input().split(' ')]
cost = 9999
for i in range(0, N):
    c, t = [int(s) for s in input().split(' ')]
    if t > T:
        continue
    cost = min(c, cost)
    
print(cost if cost < 9999 else 'TLE')

Submission status: Accepted

Solution code:
n, T = map(int, input().split())
try:
    c = min(c for c, t in [map(int, input().split()) for _ in range(n)] if t <= T)
    print(c)
except:
    print("TLE")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import os, sys, re, math

(N, T) = [int(i) for i in input().split()]

min_cost = sys.maxsize
for i in range(N):
    (c, t) = [int(j) for j in input().split()]
    if t <= T and c < min_cost:
        min_cost = c

print (min_cost if min_cost < sys.maxsize else 'TLE')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,T=map(int,input().split())
ansc=1000
k=0
for _ in range(n):
    c,t=map(int,input().split())
    if T>=t:
        ansc=min(c,ansc)
    else:
        k+=1
if not n==k:
    print(ansc)
else:
    print('TLE')

Submission status: Accepted

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: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from bisect import bisect

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, T = MAP()
ct = [LIST() for _ in range(N)]

ans = 10000
for c, t in ct:
	if t <= T:
		ans = min(ans, c)
if ans == 10000:
	print("TLE")
else:
	print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 10**4
for i in range(N):
    c, t = map(int, input().split())
    if t <= T:
        ans = min(ans, c)
if ans == 10**4:
    ans = 'TLE'
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(n):
  ci, ti = map(int, input().split())
  if ti <= t:
      c_list.append(ci)
      
if c_list == []:
    print('TLE')
else:
    print(min(c_list))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,t=map(int,input().split())
l=[list(map(int,input().split())) for i in range(n)]
l=[[j for j in i] for i in l if i[1]<=t]
s=0
for i in l:
  s+=i[1]
if s!=0:
  print(min(l)[0])
else:
  print('TLE')

Submission status: Accepted

Solution code:
from operator import itemgetter

N, T = map(int, input().split())
c = []
t = []
IDX = []

for idx in range(N):
    tmp, tmp2 = map(int, input().split())
    c.append(tmp)
    t.append(tmp2)
    IDX.append(idx+1)

ctIDX = [list(x) for x in zip(c,t,IDX) if x[1] <= T]
ctIDX = sorted(ctIDX, key=itemgetter(0))

try:
    print(ctIDX[0][0])
except:
    print("TLE")

Submission status: Accepted

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,t = map(int,input().split())
ct = [list(map(int,input().split())) for _ in range(n)]
ct.sort(key = lambda x:x[1])
ans = 10**9
for path in ct:
  if path[1] > t:
    break
  else:
    ans = min(ans ,path[0])
print(ans if ans != 10**9 else "TLE")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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)
print(min(ans) if ans!=[] else 'TLE')

Submission status: Accepted

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