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: Runtime Error

Solution code:
num, time_lim = list(map(int, input().spli()))
ans = 'TLE'
for i in range(num):
  cost, time_data = list(map(int, input().spli()))
  if time_data > time_lim:
    continue
  if ans == 'TLE':
    ans = cost
  if ans > cost:
    ans = cost
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

N,T=input_N_T()

min_c,min_t=1001,1001

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

print(ans)

Submission status: Runtime Error

Solution code:
import itertools
N, T = map(int, input().split())
CT = list(map(lambda _ :list(map(int, input().split())), range(N)))
print(min(filter(lambda ct: ct[1]<=T, CT), key=(lambda ct: ct[0]))[0])

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
N, T = map(int, input().split())
c = [[int(i) for i in input().split()] for i in range(N)]
cost = 100000000000000000000000000000
for i in range(n):
    if c[i][1]<=T and cost>c[i][0]:
        cost = c[i][0]
if cost == 100000000000000000000000000000:
    print("TLE")
else:
    print(cost)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n,t=list(map(int,input().split()))
lis = []
for i in range(n):
  s,k = list(map(int,input().split()))
  if k <= t:
    lis.append(s)
print(min(lis))

Submission status: Runtime Error

Solution code:
N, T = map(int, input().split())
ans = 1001
for i in range(N):
    cost, tm = map(int, input().split())
    if tm <＝ T:
        ans = min(ans, cost)
if ans == 1001:
    ans = "TLE"
print(ans)

Submission status: Runtime Error

Solution code:
# 帰宅経路数と時間を取得
N, T = map(int, input().split())
# 時間制限
ans = 1001
# N個の帰宅経路と時間を取得し、比較する
for i in range(N):
    cost, time = map(int, input().split())
    if time <＝ T:
        ans = min(ans, cost)
# 出力する
if ans == 1001:
    ans = "TLE"
print(ans)

Submission status: Runtime Error

Solution code:
# 帰宅経路数と時間を取得
N, T = map(int, input().split())
# 時間制限
ans = 1001
# N個の帰宅経路と時間を取得し、比較する
for i in range(N):
    cost, time = map(int, input().split())
    if time <＝ T:
        ans = min(ans, cost)
# 出力する
if ans == 1001:
    print("TLE")
else:
    print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n, t;
  cin >> n >> t;
  vector<int> cost(n);
  vector<int> time(n);
  for (int i = 0; i < n; i ++) {
    cin >> cost.at(i) >> time.at(i);
  }

  int ans = 1000;
  for (int i = 0; i < n; i ++) {
    if (ans >= cost.at(i) && t >= time.at(i)) {
      ans = cost.at(i);
    }
  }

  cout << ans << endl;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

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

l=sorted(l,key=lambda x:x[0])
for i in l:
    if i[1]<=t:
        print(i[0])
        exit(1)
print('TLE')

Submission status: Runtime Error

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

filctl = []
for elm in ctl:
    if elm[1] <= tm:
        filctl.append(elm)

filctl = sorted(filctl)
print((filctl[0])[0])

Submission status: Runtime Error

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

filctl = []
for elm in ctl:
    if elm[1] <= tm:
        filctl.append(elm)

filctl = sorted(filctl)
print(filctl[0])

Submission status: Runtime Error

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

min = 1001
for ii in ranga(N):
  c,t = map(int,input().split())
  if t <= T:
    min = c if min > c:
   
if t == 1001:
  print('TLE')
else:
  print(min)

Submission status: Runtime Error

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

min = 1001
for ii in ranga(N):
  c,t = map(int,input().split())
  if t <= T:
    min = t if min > t
   
if t == 1001:
  print('TLE')
else:
  print(min)

Submission status: Runtime Error

Solution code:

def main04():
    buf = input("");
    bufs = buf.split(" ");
    val1 = [];
    for i in range(len(bufs)):
        val1.append(int(bufs[i]));
    val2 = [];
    for i in range(val1[0]):
        buf = input("");
        bufs = buf.split(" ");
        kari = [];
        kari.append(int(bufs[0]));
        kari.append(int(bufs[1]));
        val2.append(kari);
    min1 = 10000;
    for i in range(val1[0]):
        if val2[1][i] < val1[1] and val2[0][i] < min1:
            min1 = val2[0][i];
    if min1 == 10000:
        print("TLE");
    else:
        print(min1);

if __name__ == '__main__':
    main04()

Submission status: Runtime Error

Solution code:
def main04():
    buf = input("");
    bufs = buf.split(" ");
    val1 = [];
    for i in range(len(bufs)):
        val1.append(int(bufs[i]));
    val2 = [];
    for i in range(val1[0]):
        buf = input("");
        bufs = buf.split(" ");
        kari = [];
        kari.append(int(bufs[0]));
        kari.append(int(bufs[1]));
        val2.append(kari);
    min1 = 10000;
    for i in range(val1[0]):
        if val2[1][i] < val1[1] and val2[0][i] < min1:
            min1 = val2[0][i];
    if min1 == 10000:
        print("TLE");
    else:
        print(min1);

if __name__ == '__main__':
    main03()

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

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(num,c)

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

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N, T = map(int, input().split())
c = []
t = []
for i in range(N):
    x, y = map(int, input().split())
    c.append(x)
    t.append(y)
if T >= min(t):
    for j in range(len(t)-1):
        if T < t[j]:
            c.pop(j)
            t.pop(j)
        else:
            pass
    print(min(c))
else:
    print("TLE")

Submission status: Runtime Error

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

Submission status: Runtime Error

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)
  else:
    continue

if not A:
  print('TLE')
else:
  print(min(A))

Submission status: Runtime Error

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)
  else:
    continue

if not A:
  print('TLE')
else:
  print(max(A))

Submission status: Runtime Error

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

y = min(c for c, t in x if t <= limit)
print(y)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import collections

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

input_dict = collections.OrderedDict()

for _ in range(n):
    a, b = list(map(int, input().split()))
    input_dict[a] = b

t = min([value for key, value in input_dict.items() if key <= T])

ans = [i for i, x in enumerate(input_dict.values()) if x == t]

if ans is []:
    print('TLE')

else:
    print(list(input_dict.keys()).index(ans))

Submission status: Runtime Error

Solution code:
A,B = (input().split())
A = int(A)
B = int(B)
roads = []
for i in range(A):
    a, b = input().split()
    a = int(a)
    if t in range(1, B + 1):
        roads.append((int(a), b))

if len(roads) == 0:
    print("TLE")
else:
    roads.sort()
    print(roads[0][0])

Submission status: Runtime Error

Solution code:
a,b = (input().split())
a = int(a)
b = int(b)
roads = []
for i in range(a) :
   c , t = input().split()
    t = int(t)
    if t in range (1, b + 1):
        roads.append((int(c) ,t))
 
if len(roads) == 0 :
    print ("TLE")
else:
    roads.sort()
    print (roads[0][0])

Submission status: Runtime Error

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((i+1,c))
        
x.sort(key=lambda tup: tup[1])

print(x[0][0])

Submission status: Runtime Error

Solution code:
N = input()
N = int(N)
T = input()
T = int(T)
c = 0
t = 0
count = 0
tmpC = 1001
tmpT = T

while count < N:
    c = input()
    c = int(c)
    t = input()
    t = int(t)
    count = count + 1;
    if tmpT > t:
        tmpT = t
        tmpC = c
    elif tmpT == t:
        if tmpC > c:
            tmpC = c

if T < tmpT:
    print("TLE")
    
else:
    print(tmpC)
    print(tmpT)

Submission status: Runtime Error

Solution code:
N = int(input())
T = int(input())
c_min = -1

for i in range(N):
    c = int(input())
    t = int(input())
    if t <= T:
        if c_min == -1:
            c_min = c
        else:
            if c < c_min:
                c_min = c
if c_min == -1:
    print("TLE")
else:
    print(c)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

res = 10000

for i in range(N):
  if L[1] <= T:
    if res > L[0]:
      res = L[0]
     
if res == 10000:
  res = 'TLE'
print(res)

Submission status: Runtime Error

Solution code:
n = int(input())

xyh = []

for i in range(n):
    xyh.append(list(map(int, input().split())))

isOk = False
i = 0
j = 0
constant = -1

for i in range(101):
    for j in range(101):

        constant = -1
        for xyhTemp in xyh:
            if xyhTemp[2] != 0:
                temp = xyhTemp[2] + abs(i - xyhTemp[0]) + abs(j - xyhTemp[1])

                if constant == -1:
                    constant = temp

                if constant != temp:
                    break
        else:

            for p in xyh:
                if p[2] == 0 and constant - abs(i - p[0]) - abs(j - p[1]) > 0:
                    break
            else:
                isOk = True
                break
        
    if isOk:
        break

print(i, j, constant)

Submission status: Runtime Error

Solution code:
ct=[]
for i in range(N):
    ct.append(list(map(int, input().strip().split(' '))))
    
tle=True
c=10000

for i in range(N):
    if ct[i][1]<=T:
        tle=False
        c=min(c,ct[i][0])
        
if tle:
    print('TLE')
else:
    print(c)

Submission status: Runtime Error

Solution code:
ct=[]
for i in range(N):
    ct.append(list(map(int, input().strip().split(' '))))
    
tle=True
c=100000000

for i in range(N):
    if ct[i][1]<=T:
        tle=False
        c=min(c,ct[i][0])
        
if tle:
    print('TLE')
else:
    print(c)

Submission status: Runtime Error

Solution code:
N,T=input().split()
a=0
b=0
i=0
for i in range(int(N)):
    c,t=input().split()
    if int(t)<=int(T):
        while b==0:
            a=c
            b+=1
        if int(c)<int (a):
            a=c
            i+=1
if i==0or a==0:
    print("TLE")
else :
    print(a)

Submission status: Runtime Error

Solution code:
N,T=input().split()
a=0
b=0
for i in range(int(N)):
    c,t=input().split()
    if int(t)<=int(T):
        if b==0:
            a=c
            b+=1
        if int(c)<int (a):
            a=c
            i+=1
if a==0:

Submission status: Runtime Error

Solution code:
N,T=input().split()
a=0
b=0
for i in range(int(N)):
    c,t=input().split()
    if int(t)<=int(T):
        if b==0:
            a=c
            b+=1
        if int(c)<int (a):
            a=c
            i+=1
if a==0:
    print("TLE")
else :
    print(a)
    ckdljfskldklsakldlksafkdshfhkfhsdkfkjdshfjkhskfkjsfkjlsalkjdhkjashdkhJKDHKAJHDKSHDSAHDIUAHFIUAHSFUAHFAULHFLKUASHFKULHSUAKLHDKUHFSUKHN,T=input().split()
a=0
b=0
for i in range(int(N)):
    c,t=input().split()
    if int(t)<=int(T):
        if b==0:
            a=c
            b+=1
        if int(c)<int (a):
            a=c
            i+=1
if a==0:
    print("TLE")
else :
    print(a)
    ckdljfskldklsakldlksafkdshfhkfhsdkfkjdshfjkhskfkjsfkjlsalkjdhkjashdkhJKDHKAJHDKSHDSAHDIUAHFIUAHSFUAHFAULHFLKUASHFKULHSUAKLHDKUHFSUKH

Submission status: Runtime Error

Solution code:
N, T=map(int, input().split())
 
c_list=[]
t_list=[]
ans_list=[]
for i in range(N):
  c,t=map(int, input().split())
  c_list.append(c)
  t_list.append(t)
 
ct_dict=dict(zip(c_list, t_list))  
  
if T<=min(t_list):
  print("TLE")
else:
  for k,v in ct_dict.items():
    if v<=T:
      ans_list.append(k)
 
print(min(ans_list))

Submission status: Runtime Error

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

c_list=[]
t_list=[]
ans_list=[]
for i in N:
  c,t=map(int, input().split())
  c_list.append(c)
  t_list.append(t)

ct_dict=dict(zip(c_list, t_list))  
  
if T<=min(t_list):
  print("TLE")
else:
  for k,v in ct_dict.items():
    if v<=T:
      ans_list.append(k)

print(min(ans_list))

Submission status: Runtime Error

Solution code:
N , T = map(int, input().split())
mini = T
x = 0
y = 0
for i in range(N):
    c , t = input().split()
for j in range(N-1):
    if int(t[j])<mini:
        mini = int(t[j])
        x = j
if mini<T:
    print(c[j-1])
else:
    print("TLE")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N=int(input())
T=int(input())
check=1
ansc=1001

for i in range(N):
    c=int(input())
    t=int(input())

    if t<T and c<ansc:
        ansc=c
        T=t
        check=0

if check==0:
    print(ansc)
else:
    print('TLE')

Submission status: Runtime Error

Solution code:
li = str(input).split(" ")
NT = list(map(int,li))
N = NT[0]
T = NT[1]
i = 1
mi = 9999
while i <= 3:
    a = list(map(int,input.split()))
    c = a[0]
    t = a[1]
    if t <= T and c < mi:
        mi = c
    i += 1

if mi == 9999:
    print("TLE")
else:
    print()

Submission status: Runtime Error

Solution code:
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(1000000)


# Debug output
def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))


# Binary converter
def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]


def gcd(n, m):
    if n % m == 0:
        return m
    else:
        return gcd(m, n % m)


def gcd_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = gcd(v, L[i])

    return v


def lcm(n, m):
    return (n * m) // gcd(n, m)


def lcm_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = lcm(v, L[i])

    return v


# Width First Search (+ Distance)
def wfs_d(D, N, K):
    """
    D: 隣接行列(距離付き)
    N: ノード数
    K: 始点ノード
    """

    dfk = [-1] * (N + 1)
    dfk[K] = 0

    cps = [(K, 0)]
    r = [False] * (N + 1)
    r[K] = True
    while len(cps) != 0:
        n_cps = []
        for cp, cd in cps:
            for i, dfcp in enumerate(D[cp]):
                if dfcp != -1 and not r[i]:
                    dfk[i] = cd + dfcp
                    n_cps.append((i, cd + dfcp))
                    r[i] = True

        cps = n_cps[:]

    return dfk


# Depth First Search (+Distance)
def dfs_d(v, pre, dist):
    """
    v:  現在のノード
    pre: １つ前のノード
    dist: 現在の距離

    以下は別途用意する
    D: 隣接リスト(行列ではない)
    D_dfs_d: dfs_d関数で用いる，始点ノードから見た距離リスト
    """

    global D
    global D_dfs_d

    D_dfs_d[v] = dist

    for next_v, d in D[v]:
        if next_v != pre:
            dfs_d(next_v, v, dist + d)

    return


def sigma(N):
    ans = 0
    for i in range(1, N + 1):
        ans += i
    return ans


def comb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2, r + 1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p - 1, r, p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def bisearch(L, target):
    low = 0
    high = len(L) - 1
    
    while low <= high:
        mid = (low + high) // 2
        guess = L[mid]
        if guess == target:
            return True
        elif guess < target:
            low = mid + 1
        elif guess > target:
            high = mid - 1
    if guess != target:
        return False

# --------------------------------------------

dp = None


def main():
    N, T = li_input()
    A = []

    for i in range(N):
        A.append(li_input())

    ans = 9999999999999999999

    for a in A:
        c, t = a

        if t <= T and c < ans:
            ans = c
    if ans != 9999999999999999999
        print(ans)
    else:
        print("TLE")


main()

Submission status: Runtime Error

Solution code:
N = d[0]
T = d[1]
min = 10000
for i in range(0, N-1):
    d = list(map(int,input().strip().split(' ')))
    c = d[0]
    t = d[1]
    if t <= T:
        if min >= c:
            min = c
if min == 10000:
    print("TLE")
    exit()
print(min)

Submission status: Runtime Error

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

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

print('TLE' if ans==1003 else ans)

Submission status: Runtime Error

Solution code:
N,T=map(int,input().split()) 
i=0
ctdict={}

while i<N:
    key,value=map(int,input().split()) #N個の受け取り
    ctdict[key]=value
    i+=1

ctdict = sorted(ctdict.items()) #キーの降順ソート

j=0

while j<N:
    if ctdict[j][1]<=T:
        break
    j+=1

if j==N:
    print("TLE")
else:
    print(ctdict[j][0])

Submission status: Runtime Error

Solution code:
N,T=map(int,input().split())
i=0
ctdict={}
while i<N:
    key,value=map(int,input().split())
    ctdict[key]=value
    i+=1

ctdict = sorted(ctdict.items())

j=0
ansT=0
ansT=T+1
while j<N:
    ansT=ctdict[j][1]
    if ansT<=T:
        break
    j+=1

if j==N:
    print("TLE")
else:
    print(ctdict[j][0])

Submission status: Runtime Error

Solution code:
N,T=map(int,input().split())
i=0
ctdict={}
while i<N:
    key,value=map(int,input().split())
    ctdict[key]=value
    i+=1

ctdict = sorted(ctdict.items())

j=0
ansT=T+1
while j<N:
    ansT=ctdict[j][1]
    if ansT<=T:
        break
    j+=1

if j==N:
    print("TLE")
else:
    print(ctdict[j][0])

Submission status: Runtime Error

Solution code:
N,T=map(int,input().split())
i=0
ctdict={}
while i<N:
    key,value=map(int,input().split())
    ctdict[key]=value
    i+=1

ctdict = sorted(ctdict.items())

j=0
ansT=T+1
while ansT>=T and j<N:
    ansT=ctdict[j][1]
    j+=1

if j==N:
    print("TLE")
else:
    print(ctdict[j-1][0])

Submission status: Runtime Error

Solution code:
N,T=map(int,input().split())
i=0
ctdict={}
while i<N:
    key,value=map(int,input().split())
    ctdict[key]=value
    i+=1

ctdict = sorted(ctdict.items())

j=0
ansT=T+1
while ansT>T and j<N:
    ansT=ctdict[j][1]
    j+=1

if j==N:
    print("TLE")
else:
    print(ctdict[j-1][0])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

cost = 1000
check = -1

for i in range(N):
    if t[i] <=T and c[i] <= cost:
        check = i
        cost = c[i]
        #print(i)
        #print(cost)

if index == -1:
    print('TLE')
else:
    print(cost)

Submission status: Runtime Error

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

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

cost = 0

for i in range(N):
    if array[i][1] <= T and (cost == 0 or cost < array[i][0]:
    　   cost = arrayp[i][0]
if cost == 0:
    print('TLE')
print(cost)

Submission status: Runtime Error

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

for i in range(N):
    t = [int(i) for i in input().split(" ")]
    if t[1] <= T:
        c.append(t[0])
        t.append(t[1])

print(min(c))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
n,t = map(int,input().split())
ans_cost = float('inf')
ans_time = t

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


if ans_cost == float('inf'):
    print("TLE")
else:
     print(ans_cost)

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

Solution code:
N,T=map(int,input().split())
s=2000
for i in range(N):
    a,b=map(int,input().split())
    if b<=T:s=min(s,a)
print(s if ans<2000 else "TLE")

Submission status: Runtime Error

Solution code:
import numpy as np
N, M = list(map(int, input().split()))
can = []
for i in range(1, int(np.sqrt(M)) + 1):
	if M % i == 0:
		if N <= M // i:
			can.append(i)
		if N <= i:
			can.append(M // i)

if N == 1:
	print(M)
else:
	print(max(can))

Submission status: Runtime Error

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

print(min(can))