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 = map(int, input().split())
li = [list(map(int, input().split())) for i in range(N)]
ans = 20000
for l in li :
    if l[1] <= T and l[0] < ans :
        ans = l[0]
print(ans if ans != 20000 else "TLE")

Submission status: Accepted

Solution code:
n,t = map(int,input().split())
ans = 10000
for _ in range(n):
    a, b = (int(x) for x in input().split())
    if b <= t:
        ans = min(ans, a)
if ans == 10000:
    print('TLE')
else:
    print(ans)

Submission status: Accepted

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

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

if x == []:
    print("TLE")
else:
    print(min(x))

Submission status: Accepted

Solution code:
n,t = map(int,input().split())
cost = []
time = []
ncost = []
f = 0
e = 0
for i in range(n):
    c,T = input().split()
    cost.append(int(c))
    time.append(int(T))

for i in time:
    if i > t:
        e += 1
    
if e == n:
    print('TLE')
    
for i in range(n):
    if time[i] <= t:
        ncost.append(cost[i])
        f = 1
    else:
        pass
if  f == 1:
    print(min(ncost))

Submission status: Accepted

Solution code:
N,T = map(int, input().split())
ct=[list(map(int, input().split())) for _ in range(N)]
#print(ct)
max=1001
for i in range(N):
    if ct[i][1]>T:
        continue
    else:
        if ct[i][0]<max:
            max=ct[i][0]
if max==1001:
    print('TLE')
else:
    print(max)

Submission status: Accepted

Solution code:
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    n,T=INTM()
    ct=1001
    for i in range(n):
        c,t=INTM()
        if T>=t:
            ct=min(ct,c)
    if ct==1001:
        print('TLE')
    else:
        print(ct)
if __name__ == '__main__':
    do()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, T = map(int, input().split())
cost = []
for _ in range(N):
    c, t = map(int, input().split())
    if t <= T:
        cost.append(c)

cost.sort()
if len(cost) == 0:
    print('TLE')
else:
    print(cost[0])

Submission status: Accepted

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

Submission status: Accepted

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

#----------
N,T = list(map(int, input().rstrip().split()))
ct_list = [list(map(int, input().rstrip().split())) for _ in range(N)]
#----------

temp_list=[]
for c,t in ct_list:
    if t <= T:
        temp_list += [[c,t]]

if temp_list == []:
    print("TLE")
else:
    index=0
    c_min=ct_list[0][0]
    for i,[c,t] in enumerate(temp_list):
        if c_min > c:
            index = i
            c_min = c
    
    print(c_min)

Submission status: Accepted

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

m = 1001
for _ in range(n):
    ci, ti = map(int,input().split())
    if ti > t:
        continue
    if ci < m:
        m = ci
print("TLE" if m == 1001 else m)

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

Submission status: Accepted

Solution code:
import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni = lambda: int(ns())
nin = lambda y: [ni() for _ in range(y)]
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda y: [na() for _ in range(y)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda y: [ns() for _ in range(y)]
ncl = lambda y: [list(ns()) for _ in range(y)]
nas = lambda: stdin.readline().split()

N, T = na()
ct = nan(N)

ans = inf
for i in range(N):
    c, t = ct[i]
    if t <= T:
        ans = min(ans, c)

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

Submission status: Accepted

Solution code:
n,t=map(int,input().split())
ct=[list(map(int,input().split())) for i in range(n)]
ans=float('inf')
ok=False
for i in range(n):
  if ct[i][1]<=t:
    ans=min(ans,ct[i][0])
    ok=True
if ok:
  print(ans)
else:
  print('TLE')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve():
    N, T = [int(_) for _ in input().split()]
    res = 100000
    for i in range(N):
        c, t = [int(_) for _ in input().split()]
        if t <= T:
            res = min(res, c)
    if res < 1001:
        return res
    else:
        return 'TLE'

if __name__ == '__main__':
    print(solve())

Submission status: Accepted

Solution code:
#112_B
N,T=map(int,input().split())
Ans=10**4
for _ in range(N):
    c,t=map(int,input().split())
    if t<=T:
        Ans=min(Ans,c)
print('TLE' if Ans==10**4 else Ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
C=[];D=[];cost=1001;num=-1
N,T=map(int,input().split())
for i in range(N):
  c,t=map(int,input().split())
  C.append(c)
  D.append(t)
for i in range(N):
  if D[i]<=T:
    if C[i]<cost:
      cost=C[i]
      num=i
      #print(i,cost)
print(C[num] if num!=-1 else "TLE")

Submission status: Accepted

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

ans = 10**15

for i in range(n):
  c, t = map(int, input().split())
  if t <= T:
    ans = min(ans, c)
    
print(ans if ans != 10**15 else "TLE")

Submission status: Accepted

Solution code:
N, T = map(int, input().split())
m = 1000000000
for i in range(N):
    c, t = map(int, input().split())
    if t <= T:
        if c < m:
            m = c

if m < 1000000000:
    print(m)
else:
    print("TLE")

Submission status: Accepted

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

INF = 10**9

min_cost = INF
for _ in range(N):
  c,t = map(int,input().split())
  if t <= T:
    min_cost = min(min_cost,c)

answer = min_cost if min_cost < INF else 'TLE'
print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

def main():
    N, T = map(int, input().split())
    MAX_ANS = 10000
    ans = MAX_ANS
    for _ in range(N):
        c, t = map(int, input().split())
        if c < ans and t <= T:
            ans = c
    if ans == MAX_ANS:
        print('TLE')
    else:
        print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,T=map(int,input().split())
c=[]
t=[]
d=[]
for _ in range(N):
  c_i,t_i=map(int,input().split())
  c.append(c_i)
  t.append(t_i)
if min(t)>T:
  print("TLE")
  exit()
for i in range(N):
  if t[i]<=T:
    d.append(c[i])
w=min(d)
print(w)

Submission status: Accepted

Solution code:
n,t = map(int, input().split())
sh = float("inf")
l = list()

for i in range(n):
    a,b = map(int, input().split())
    if t >= b:
        if a < sh:
            sh = a
if sh == float("inf"):
    print("TLE")
else:
    print(sh)

Submission status: Accepted

Solution code:
n,T = [int(x) for x in input().split()]
ct = []
for _ in range(n):
    c,t = [int(x) for x in input().split()]
    ct.append([c,t])

ans = 10000
for i in range(n):
    if ct[i][1] > T:
        pass
    else:
        ans = min(ct[i][0],ans)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, T = map(int, input().split())
    
ans = 10**9
for _ in range(n):
    c, t = map(int, input().split())
    if t <= T and c < ans:
        ans = c
    
if ans == 10**9:
    print('TLE')
else:
    print(ans)

Submission status: Accepted

Solution code:
n, T = map(int, input().split())
l = []
for _ in range(n):
    c, t = map(int, input().split())
    l.append([c, t])
    
l.sort()
for i in range(n):
    if l[i][1] <= T:
        print(l[i][0])
        break
    if i == n-1 and l[i][1] > T:
        print('TLE')

Submission status: Accepted

Solution code:
N, T = map(int, input().split())
ct = []
for _ in range(N):
    c, t = map(int, input().split())
    if t > T:
        pass
    else:
        ct.append([c,t])
try:
    print(sorted(ct, key=lambda x: x[0])[0][0])
except IndexError:
    print('TLE')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,tl=map(int,input().split())
c=[]
t=[]
cl=[1001]
for i in range (n):
    c1,t1=[int(i) for i in input().split()]
    c.append(c1)
    t.append(t1)

for i in range(n):
    if  int(t[i])<=tl:
        cl.append(c[i])
if min(cl)==1001:
    print('TLE')
else:
    print(min(cl))

Submission status: Accepted

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

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

    if t<=T and c<min_cost:
        min_cost=c

print("{}".format(min_cost if min_cost!=10000 else "TLE"))

Submission status: Accepted

Solution code:
n,t=map(int,input().split())
a=[[int(i) for i in input().split()] for l in range(n)]
a=sorted(a)
for x in a:
    if x[1]<=t:
        print(x[0])
        exit(0)
print("TLE")

Submission status: Accepted

Solution code:
N,T=[int(i)for i in input().split()]
c=[]
t=[]
for i in range(N):
    a,b=[int(j)for j in input().split()]
    c.append(a)
    t.append(b)

ans=1<<30
for i in range(N):
    if t[i]<=T and c[i]<ans:ans=c[i]
if ans==1<<30:ans="TLE"
print(ans)

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)

print(ans if ans!=10**4 else 'TLE')

Submission status: Accepted

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

Submission status: Accepted

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

ans = 1e9

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np


def main():
    N, T = map(int, input().split())
    CT = np.array([list(map(int, input().split())) for _ in range(N)])
    roots = CT[(CT[:, -1] <= T)]
    if roots.size == 0:
        print('TLE')
    else:
        print(np.min(roots, axis=0)[0])


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

if num == 9999:
  print('TLE')
else:
  print(num)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,t=map(int,input().split())
ct=[list(map(int,input().split())) for i in range(n)]
ct=[i for i in ct if i[1]<=t]
if len(ct)==0:
  print("TLE")
  exit()
ct.sort()
print(ct[0][0])

Submission status: Accepted

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

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

ct.sort()

ans = 0
for i in range(n):
    if ct[i][1] <= k:
        ans = ct[i][0]
        break

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

Submission status: Accepted

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

path = []
for _ in range(N):
  c, t = list(map(int, input().split()))
  if t <= T:
    path.append(c)
path.sort()
if len(path) > 0:
  print(path[0])
else:
  print('TLE')

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)
if len(C) >= 1:
  C.sort()
  print(C[0])
else:
  print('TLE')

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

Submission status: Accepted

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

answer = float('inf')
ct = zip(c,t)
for i,j in ct:
    if j<=T:
        answer = min(answer, i)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

INF = 10**3 + 1

c_min = INF

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

print("TLE" if c_min == INF else c_min)

Submission status: Accepted

Solution code:
N,T=map(int,input().split())
L=[list(map(int,input().split())) for _ in range(N)]
c=1001
for i in range(N):
    if L[i][1]<=T:
        c=min(c,L[i][0])
if c<1001:
    print(c)
else:
    print("TLE")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

d = {}
for _ in range(N):
    Ns = [int(i) for i in input().split()]
    time = Ns[1]
    if time <= T:
        d[Ns[0]] = time
if d:
    print(min(d))
else:
    print('TLE')

Submission status: Accepted

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

d = {}
for _ in range(N):
    Ns = [int(i) for i in input().split()]
    time = Ns[1]
    if time <= T:
        d[Ns[0]] = Ns[1]
if d:
    print(min(d))
else:
    print('TLE')

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for c, ti in sorted(ct):
	if int(ti) <= t:
		print(c)
		exit()
	

print("TLE")

Submission status: Accepted

Solution code:
N,T=map(int,input().split())
ans=10**9

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 9999
for i in range(n):
    if arr[i][1] <= t:
        if arr[i][0] <= ans:
            ans = arr[i][0]
if ans == 9999:
    print("TLE")
else:
    print(ans)

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('TLE')
else:
    print(min(l))

Submission status: Accepted

Solution code:
N,T=map(int,input().split())
W=[list(map(int,input().split())) for i in range(N)]
flag=0
cost=0
W.sort(key=lambda x:x[0])

for i in range(N):
    if (W[i][1]<=T):
        flag=1
        cost=W[i][0]
        break

if flag==1:
    print(cost)
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 and c < m:
        m = c
if m == 1001:
    print('TLE')
else:
    print(m)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    N, T = map(int, input().split(" "))
    cost = 10000
    tle = 0
    for _ in range(N):
        c, t = map(int, input().split(" "))
        if t > T:
            tle += 1
            continue
        else:
            cost = min(cost, c)
    if tle == N:
        print("TLE")
    else:
        print(cost)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# easy!
n,t = map(int,input().split())
l = [ list(map(int,input().split(" "))) for i in range(n)]

l = sorted(l) # 2次リストのindex'0'でソートされる

for j in range(n):
    if l[j][1] <= t:
        print(l[j][0])
        break
else:
    print('TLE')

Submission status: Accepted

Solution code:

n,t = map(int,input().split())
l = [ list(map(int,input().split(" "))) for i in range(n)]
#print(l)

l = sorted(l)
#print(l)

for j in range(n):
    if l[j][1] <= t:
        print(l[j][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 len(ans) == 0:
    print('TLE')
else:
    print(min(ans))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
n,time= map(int,input().split())
c = []
t = []
for i in range(n):
    a,b = map(int,input().split())
    c.append(a)
    t.append(b)
ans = 1001
for i in range(n):
    if time >= t[i]:
        if ans >= c[i]: ans = c[i]
if ans == 1001: print("TLE")
else: 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)

print('TLE' if ans > 1000 else ans)

Submission status: Accepted

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

ans = 1<<60
for _ in range(N):
  cost, time = map(int, input().split())
  if time <= T:
    ans = min(cost, ans)
print(ans if ans < 1<<60 else "TLE")

Submission status: Accepted

Solution code:
import sys
import math
import itertools

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

Submission status: Accepted

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

min_cost = 1001

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

Submission status: Accepted

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

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

for i in range(n):
    if ct[i][1] <= t:
        print(ct[i][0])
        exit()
    if i == n - 1:
        print("TLE")

Submission status: Accepted

Solution code:
import sys

INPUT = lambda: sys.stdin.readline().rstrip()
MAP = lambda: map(int, INPUT().split())

sys.setrecursionlimit(10 ** 9)
INF = float('inf')


def main():
    N, T = MAP()

    ans = INF
    for i in range(N):
        c, t = MAP()
        if t <= T: ans = min(ans, c)

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n,limit = map(int, input().split())
cost = float('INF')
for i in range(n):
  c,t = map(int, input().split())
  if limit >= t and cost > c:
    cost = c
if cost <= 1000:
  print(cost)
else:
  print('TLE')

Submission status: Accepted

Solution code:
"""
author : halo2halo
date : 22, Jan, 2020
"""

import sys
import itertools
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N, T = map(int, readline().split())
ans = 10000
for _ in range(N):
    c, t = map(int, readline().split())
    if c <= ans and t <= T:
        ans = c

print("TLE" if ans == 10000 else 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=map(int,input().split())
p=[]
for _ in range(N):
  c=list(map(int,input().split()))
  p.append(c)
ans=9999
for c in p:
  if c[1]<=T:
    if c[0]<ans:
      ans=c[0]
if ans==9999:
  print('TLE')
else:
  print(ans)

Submission status: 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 not ans:
    print("TLE")
else:
    print(min(ans))

Submission status: Accepted

Solution code:
def p_b():
    N, T = map(int, input().split())
    ans = 10 ** 9
    for _ in range(N):
        c, t = map(int, input().split())
        if t <= T:
            ans = min(ans, c)
    print(ans if ans != 10 ** 9 else "TLE")
    
p_b()

Submission status: Accepted

Solution code:
(N, T), *D,  = [list(map(int, s.split())) for s in open(0)]

min_cost = 1e10
idx = 0
for i in range(len(D)):
    if T >= D[i][1] and D[i][0] < min_cost:
        idx = i
        min_cost = D[i][0]

if min_cost == 1e10:
    print("TLE")
else:
    print(min_cost)

Submission status: Accepted

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

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())
costs = []

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

if costs:
    print(min(costs))
else:
    print('TLE')

Submission status: Accepted

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

result = 1001
for i in cList:
  if i[1] <= t:
    if result > i[0]:
      result = i[0]

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

Submission status: Accepted

Solution code:
n,t = map(int,input().split())
l = [list(map(int,input().split())) for i in range(n)]
ans = 1001
for i,j in l:
  if t >= j:
    ans = min(ans,i)
if ans == 1001:
  print("TLE")
else:
  print(ans)

Submission status: Accepted

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

for i in range(n):
  ci, ti = map(int, input().split())
  if ti > t:
    continue
  else:
    cleared.append(ci)

if cleared:
  print(min(cleared))
else:
  print("TLE")

Submission status: Accepted

Solution code:
def solve():
    N, T = map(int, input().split())
    c, t = [0] * N, [0] * N
    for i in range(N):
        c[i], t[i] = map(int, input().split())

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


if __name__ == '__main__':
    solve()

Submission status: Accepted

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

ans = 1001

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

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
def input(): return sys.stdin.readline().rstrip()

def main():
    N,T=map(int,input().split())
    ans=INF
    for _ in range(N):
        c,t=map(int,input().split())
        if t<=T:
            ans=min(ans,c)
    print(ans if ans!=INF else 'TLE')

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,t=map(int,input().split())
l=[]
ans="TLE"
for i in range(n):
	c,time=map(int,input().split())
	if time<=t:
		l.append(c)
		ans=str(min(l))
print(ans)

Submission status: Accepted

Solution code:

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

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

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

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

Submission status: Accepted

Solution code:
n, T = map(int, input().split())
p = []
for i in range(n):
   tmp = [int(x) for x in input().split()]
   p.append(tmp)

cmin = 1001
for c, t in p:
   if (t <= T and c < cmin):
      cmin = c

if (cmin > 1000):
   print('TLE')
else:
   print(cmin)

Submission status: Accepted

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