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())

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

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

Submission status: Accepted

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

min = 9999
for i in range(N):
  if CT[i][1] <= T and CT[i][0] < min:
    min = CT[i][0]

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

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())

ans = []
for i in range(N):
    if t[i] <= T:
        ans.append(i)
if len(ans) > 0:
    print(min([c[x] for x in ans]))
else:
    print('TLE')

Submission status: Accepted

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

best = 1001
for c, t in ct:
    if t > T:
        continue
    best = min(best, c)
print(best if best < 1001 else 'TLE')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, T = map(int,input().split())
ct = [list(map(int, input().split())) for i in range(N)]
clst=[]
for i in range(N):
    if ct[i][1] <= T:
        clst.append(ct[i][0])
if len(clst) == 0:
    ans = 'TLE'
else:
    ans = min(clst)
print(ans)

Submission status: Accepted

Solution code:
N, T = [int(n) for n in input().split()]
CT = [[int(n) for n in input().split()] for _ in range(N)]

def main():
    li = list(filter(lambda t: t[-1] <= T, CT))
    if li:
        li.sort(key=lambda t: t[0])
        print(li[0][0])
    else:
        print('TLE')

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n,T=map(int,input().split())
ans=9999
flag=0
for _ in range(n):
    c,t=map(int,input().split())
    if T>=t and c<ans:
        ans=c
        flag=1
if flag==0:
    print("TLE")
else:
    print(ans)

Submission status: Accepted

Solution code:
N,T = list(map(int,input().split()))
CT   = [tuple(map(int,input().split())) for i in range(N)]
MIN = 9999999
for i in CT:
    if MIN > i[0]:
        if T >= i[1]:
            MIN = i[0]
print(MIN if not MIN == 9999999 else "TLE")

Submission status: Accepted

Solution code:
def main():
    N, T = map(int, input().split())
    data = [tuple(map(int, input().split())) for _ in range(N)]

    less_than_T_data = list(filter(lambda ct: ct[1] <= T, data))

    if less_than_T_data:
        print(min(less_than_T_data, key=lambda ct: ct[0])[0])
    else:
        print('TLE')


if __name__ == '__main__':
    main()

Submission status: Accepted

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

ans = 9999

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

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

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:
    cost = min(cost, c)
  else:
    continue

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

Submission status: Accepted

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

for x in range(0,N):
    c,t = map(int,input().split())
    ct.append([c,t])


for x in range(N-1,-1,-1):
    if ct[x][1] > T:
        ct.remove(ct[x])
    
if len(ct) == 0:
    print("TLE")
else:
    print(min(ct)[0])

Submission status: Accepted

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

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

ans = []

for c in cost:
  if c[1] < T+1:
    ans.append(c)
    
if ans != []:
  ans = sorted(ans, key=lambda x: x[0])
  print(ans[0][0])
else:
  print("TLE")

Submission status: Accepted

Solution code:
n,T=map(int,input().split())
INF=10**9
cost=INF
flag=0
for i in range(n):
  c,t=map(int,input().split())
  if t<=T:
    cost=min(cost,c)
    flag=1
if flag:
  print(cost)
else:
  print('TLE')

Submission status: Accepted

Solution code:
def main():
    mincost = float('inf')
    N, T = map(int, input().split())
    for i in range(N):
        c, t =map(int, input().split())
        if t <= T:
            if c < mincost:
                mincost = c
        else:
            pass
    print(mincost) if mincost < float('inf') else print("TLE")

main()

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())
ans = 1e10
for i in range(n):
  a,b = map(int,input().split())
  if b <= t:
    ans = min(a,ans)
if ans == 1e10:
  print("TLE")
else:
  print(ans)

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007
sys.setrecursionlimit(1000000)

#A
def A():
    n = I()
    if n == 1:
        print("Hello World")
    else:
        a,b = IR(2)
        print(a+b)
    return

#B
def B():
    n,t = LI()
    a = LIR(n)
    a.sort(key = lambda x:x[1])
    ans = float("inf")
    for i,j in a:
        if j > t:break
        ans = min(i,ans)
    if ans == float("inf"):
        print("TLE")
    else:
        print(ans)
    return

#C
def C():
    n = I()
    a = LIR(n)
    if n == 1:
        print(*a[0])
        quit()
    for cy in range(101):
        for cx in range(101):
            for i in range(n):
                x,y,h = a[i]
                if h > 0:
                    H = abs(x-cx)+abs(y-cy)+h
                    break
            f = True
            for i in range(n):
                x,y,h = a[i]
                if max(H-abs(x-cx)-abs(y-cy),0) != h:
                    f = False
                    break
            if f:
                print(cx,cy,H)
                quit()
#D
def D():
    def factorize(n):
        if n == 1:
            return [1]
        if n<4:
            return [1,n]
        l = [1,n]
        m = n
        z = 2
        while z**2 <= n:
            if m%z == 0:
                l.append(z)
                if m//z != z:
                    l.append(m//z)
            z += 1
        l = list(set(l))
        l.sort()
        return l

    n,m = LI()
    l = factorize(m)
    for i in l[::-1]:
        if n*i <= m:
            print(i)
            quit()

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == "__main__":
    B()

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)
print("TLE" if len(l)==0 else min(l))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ct = sorted(list(filter(lambda x: x[1] <= T,ct)))
if len(ct) == 0:
  print('TLE')
else:
  print(ct[0][0])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,t=map(int,input().split())
d=0
c=1000
for i in range(n):
  a,s=map(int,input().split())
  if s<=t and c>=a:
    c=a
    d=i+1
if d==0:
  print("TLE")
else:
  print(c)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N, T = [ int(x) for x in input().split() ]
cts = [[ int(x) for x in input().split() ] for _ in range(N)]

cands = list(map(lambda ct: ct[0], filter(lambda ct: ct[1] <= T, cts)))
if len(cands) == 0:
    ans = "TLE"
else:
    ans = min(cands)

print(ans)

Submission status: Accepted

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

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())

cost_min = 100000

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

if cost_min == 100000:
    print("TLE")
else:
    print(cost_min)

Submission status: Accepted

Solution code:
n, t_max = map(int, input().split())
ans = 'TLE'

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

Submission status: Accepted

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

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

print(min_cost if min_cost != float('inf') else 'TLE')

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)
if min(t)>T:
  print("TLE")
else:
  for i in range(N):
    if t[c.index(min(c))]>T:
      c[c.index(min(c))]=1001
    else:
      print(min(c))
      break

Submission status: Accepted

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

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


list_cut = [i[0] for i in list_c_t if i[1] <= T]
if len(list_cut) == 0:
  print('TLE')
else:
  print(min(list_cut))

Submission status: Accepted

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

def main():
    c_min = 9999
    for i in range(N):
        c, t = map(int, input().split())
        if c < c_min and t <= T:
            c_min = c
    if c_min != 9999:
        return c_min 
    else:
        return 'TLE'

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

Submission status: Accepted

Solution code:
import sys
n, t = map(int, input().split())
routes = [list(map(int, input().split())) for _ in range(n)]
for route in sorted(routes):
    if route[1] <= t:
        print(route[0])
        sys.exit()
print('TLE')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n,t=map(int,input().split());c=[]
for i in range(n):
  a,b=map(int,input().split())
  if b<=t:
    c.append(a)
if c==[]:print("TLE")
else:c.sort();print(c[0])

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())
c, t = [], []
for _ in range(N):
    ci, ti = map(int, input().split())
    c.append(ci)
    t.append(ti)
    
if min(t) > T:
    print('TLE')
    exit()
    
#min_time = float('inf')
min_cost = float('inf')
for i in range(N):
    if t[i] <= T and c[i] < min_cost:
        min_cost = c[i]
        
print(min_cost)

Submission status: Accepted

Solution code:
N, T  = [int(i) for i in input().split()]
C_T_list = [[int(x) for x in input().split()] for _ in range(N)]
C_T_list.sort()
ans = 0
for C_T in C_T_list:
    if C_T[1] <= T:
        ans = C_T[0]
        break

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

Submission status: Accepted

Solution code:
#coding: utf-8
N, T = map(int, input().split())
tans = T
cans = 10 ** 5
for i in range(N):
    c, t = map(int, input().split())
    if c <= cans and t <= T:
        cans, tans = c, t
print(cans if cans < 10**5 else "TLE")

Submission status: Accepted

Solution code:
N, T= map(int, input().split())
D = [list(map(int, input().split())) for _ in range(N)]
D.sort()
for c, t in D:
    if t<=T:
        print(c)
        exit()
print('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 c <= ans and t <= T:
        ans = c

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


lst = []
for i in range(N):
    data = list(map(int, input().split()))
    if data[1] <= T:
        lst.append(data)


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

Submission status: Accepted

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

Submission status: Accepted

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

for _ 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 = list(map(int,input().split()))
ct = [list(map(int,input().split())) for _ in range(N)]
ct.sort(key = lambda x:x[0])
for c,t in ct:
    if t <= T:
        print(c)
        break
else:
    print("TLE")

Submission status: Accepted

Solution code:
N,T=map(int,input().split())
ct=[]
for i in range(N):
    ct1=list(map(int,input().split()))
    ct.append(ct1)
ct.sort()
for j in ct:
    if j[1]<=T:
        print(j[0])
        exit()
print('TLE')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
N, T = map(int,input().split())
c_t = np.array([input().split() for _ in range(0, N)])
c_t = c_t.astype(int)

if np.min(c_t[:,1]) <= T:
    print(np.sort(c_t[np.where(c_t[:,1] <= T)][:,0])[0])
else:
    print('TLE')

Submission status: Accepted

Solution code:
#112
n, t0 = map(int, input().split())
ans = 10000000000
for _ in range(n):
    c, t = map(int, input().split())
    if(t<=t0 and c<=ans):
        ans = c

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

min_cost = 9999
for _ in range(N):
  c, t = list(map(int, input().split()))
  if t <= T and c < min_cost:
    min_cost = c
if min_cost == 9999:
  print('TLE')
else:
  print(min_cost)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())  # 複数数値入力
c = list()
t = list()
ans = float("inf")

for i in range(a):
    C, T = map(int, input().split())
    if T > b:
        continue

    ans = min(ans, C)

if ans == float("inf"):
    print("TLE")
else:
    print(ans)

Submission status: Accepted

Solution code:
N, T = map(int, input().split())
c_t = [[int(_) for _ in input().split()] for _ in range(N)]
flag = False
MinCost = 1000

for i in range(N):
    if c_t[i][1] <= T:
        flag = True
        if c_t[i][0] < MinCost:
            MinCost = c_t[i][0]

print(MinCost if flag else "TLE")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
n,T=map(int,input().split())
ans=1001
for i in range(n):
    c,t=map(int,input().split())
    if(t<=T and ans>c):
        ans=c
if (ans==1001):
    print("TLE")
else:
    print(ans)

Submission status: Accepted

Solution code:
def main112():
    N, T = (int(x) for x in input().split())

    candi = [0] * N

    for n in range(N):
        candi[n] = (list(map(int, input().split())))

    candi = sorted(candi, key=lambda x: x[0])

    answer = 10000

    for c in candi:
        if c[1] <= T and c[0] < answer:
            answer = c[0]

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

main112()

Submission status: Accepted

Solution code:
import sys

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

cs, ts = [], []
for i in range(N):
  c, t = [int(item) for item in input().split()]
  cs.append(c)
  ts.append(t)
    
ct = sorted(zip(cs, ts), key=lambda x:x)
for c, t in ct:
  if t <= T:
    print(c)
    sys.exit()

print("TLE")

Submission status: Accepted

Solution code:
NT=input().split()
N=int(NT[0]);T=int(NT[1])
cs=[];ts=[]
for i in range(N):
    ct=input().split()
    cs.append(int(ct[0]))
    ts.append(int(ct[1]))
ts2=[];cs2=[]
for j in ts:
    if j<=T:
        ts2.append(j)
        cs2.append(cs[ts.index(j)])
if ts2==[]:
    print("TLE")
else:
    print(str(min(cs2)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,T = map(int,input().split())
ct = sorted([list(map(int,input().split())) for i in range(n)],key = lambda x:x[0])
flag = 0
for i in range(n):
    if ct[i][1] <= T:
        flag = 1
        print(ct[i][0])
        break
if flag == 0:
    print("TLE")

Submission status: Accepted

Solution code:
n,t=map(int,input().split())
ct=[list(map(int,input().split()))for i in range(n)]
ct.sort()
a=False
for i in ct:
    if i[1]<=t:
        b=i[0]
        a=True
        break
if a:
    print(b)
else:
    print("TLE")

Submission status: Accepted

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

ct = []
for i in range(n):
    a = [int(j) for j in input().split()]
    if a[1]<=t:
        ct.append(a)
    
ct.sort()
if len(ct) > 0:
    print(ct[0][0])
else:
    print("TLE")

Submission status: Accepted

Solution code:
n, t = map(int, input().split())
ct = [list(map(int, input().split())) for i in range(n)]
ct.sort(key=lambda x : x[0])
for i in range(n):
    if ct[i][1] <= t :
        ans = ct[i][0]
        break
else:
    ans = 'TLE'
print(ans)

Submission status: Accepted

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

for i in range(N):
  c,t = map(int,input().split())
  Cost_Time.append([c,t])
  
Cost_Time.sort()
ans = -1
for i in range(N):
  if(Cost_Time[i][1]<=T):
    ans = Cost_Time[i][0]
    break
    
if(ans == -1):
  print('TLE')
else:
  print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from operator import itemgetter
N,T = [int(x) for x in input().split()]
ct = li = [[0 for j in range(2)] for i in range(N)]
for i in range(N):
    ct[i][0],ct[i][1] = [int(x) for x in input().split()]
ct.sort(key=itemgetter(0))
flag = False
for i in ct:
    if(i[1]<=T):
        print(i[0])
        flag = True
        break
if(not flag):
    print('TLE')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
N, T = map(int, input().split())
A = [list(map(int, input().split())) for _ in range(N)]
B = sorted([[c, t] for c, t in A if t <= T], key=lambda x: x[0])
if len(B) == 0:
    print('TLE')
else:
    print(B[0][0])

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(N):
    if L[i][1]<=T:
        A.append(L[i][0])
if A ==[]:
    print("TLE")
else:
    print(min(A))

Submission status: Accepted

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

list = []
for i in range(n):
    c, t = map(int,input().split())
    if t <= T:
        list.append([c,t])
    
list.sort(key = lambda x : x[0])

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

Submission status: Accepted

Solution code:
N , T = map(int, input().split())
D = []
for i in range(1, N + 1):
    ci, ti = map(int, input().split())
    if ti <= T:
        D.append(ci)
if D == []:
    print('TLE')
else:
    ans = min(D)
    print(ans)

Submission status: Accepted

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

min_cost = 100000

for x in e:
    if x[1] <= t and x[0] < min_cost:
        min_cost = x[0]

if min_cost == 100000:
    print("TLE")
else:
    print(min_cost)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
data = input().split()
N = int(data[0])
T = int(data[1])
c = []
t = []
i = 0
j = 0
while i < N:
  sc = input().split()
  c.append(int(sc[0]))
  t.append(int(sc[1]))
  i += 1

mn = min(t)
if mn > T:
  print("TLE")
else:
  mn = c[0]
  while j < N:
    if t[j] <= T:
      
      if mn >= c[j]:
        mn = c[j]
        ind = j
        
    j += 1

  print(c[ind])

Submission status: Accepted

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


def solve(N: int, T: int, c: "List[int]", t: "List[int]"):
    cand = [c[i] for i in range(N) if t[i] <= T]
    if len(cand) == 0:
        print("TLE")
    else:
        print(min(cand))
    return


# Generated by 1.1.3 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())
ct=[list(map(int,input().split())) for i in range(N)]
m=1001
for i in range(N):
    if ct[i][1]<=T:
        if ct[i][0]<m:
            m=ct[i][0]
if m==1001:
    print('TLE')
else:
    print(m)

Submission status: Accepted

Solution code:
import sys


class DataUnit(object):

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


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


def judging_COST(datali):

    if(len(datali)==0): return "TLE"

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

    return min_cost


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

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

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

    return datalist



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

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


if __name__ == "__main__":
    main()

Submission status: 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,T = map(int,input().split())

mn = 10**8
for i in range(N):
    c, t = map(int,input().split())
    if t > T:
        continue
    if c < mn:
        mn = c

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,T=map(int,input().split())
c=[]
t=[]
for i in range(N):
    ci,ti=map(int,input().split())
    c.append(ci)
    t.append(ti)
min=10**30
for i in range(N):
    if t[i]<=T and min>=c[i]:
        min=c[i]
if min==10**30:
    print("TLE")
else:
    print(min)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,T=map(int,input().split())
ctl=[list(map(int,input().split())) for _ in range(N)]
cl =[ct[0] for ct in ctl if ct[1]<=T]
print(min(cl) if len(cl)>0 else 'TLE')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n,t = map(int,input().split())
x = []
y = []
for i in range(n):
    x1,y1=[int(i) for i in input().split()]
    if(y1<=t):
        x.append(x1) #x += [x1]
        y.append(y1) #y += [y1]
print(min(x) if len(x)>0 else "TLE")

Submission status: Accepted

Solution code:
def ans():
  N, T = map(int,input().split())
  cost = 1e9
  for _ in range(N):
    c, t = map(int,input().split())
    if(t <= T):
      if(cost > c):
        cost = c
  if(cost == 1e9):
    print("TLE")
  else:
    print(cost)
ans()