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:
N,T=map(int,input().split())
c=[]
t=[]
for i in range(0,N):
	c[i],t[i]=map(int,input().split())

while(True):
  n=c.min().index()
  if(t[n]<=T):
    print(c[n])
    break
  else:
    if(len(c)==0):
      print('TLE')
      break
    else:del c[n]
         del t[n]

Submission status: Runtime Error

Solution code:
import numpy as np
N, T = map(int, input().split())
cost = 2000
time = T
for i in np.arnage(N):
    ci, ti = map(int, input().split())
    if ti < time:
        if ci < cost:
            cost = ci
            time = ti
if cost != 2000:
    print(cost)
else:
    print('TLE')

Submission status: Runtime Error

Solution code:
#include<iostream>
#include<algorithm>
#include<vector>

using namespace std;

int main(){
  int N, T; 
  cin >> N >> T;
  vector<int> c[N]
  vector<int> t[N];
  for(int i = 0; i < N; ++i) {
    cin >> c[i] >> t[i];
  }
  int MAX = 1 << 30;
  int ans = MAX;

  for (int i = 0; i < N; ++i){
    if(t[i] <= T){
      ans = min(ans, c[i]);
      
    }
  }

  if (ans <  MAX){
    cout << ans << endl;
  }
  else {
    cout << "TLE" << endl;
  }
}

Submission status: Runtime Error

Solution code:
#include<iostream>
#include<algorithm>
#include<vector>

using namespace std;

int main(){
  int N, T; 
  cin >> N >> T;
  vector<int> c[N], t[N];
  for(int i = 0, i < N; ++i) {
    cin >> c[i] >> t[i];
  }
  int MAX = 1 << 30;
  int ans = MAX;

  for (int i = 0; i < N; ++i){
    if(t[i] <= T){
      ans = min(ans, c[i]);
      
    }
  }

  if (ans <  MAX){
    cout << ans << endl;
  }
  else {
    cout << "TLE" << endl;
  }
}

Submission status: Runtime Error

Solution code:
#include<iostream>
#include<algorithm>
#include<vector>

using namespace std;

int main(){
  int N, T; cin >> N >> T;
  vector<int> c[N], t[N];
  for(int i = 0, i < N; ++i) {
    cin >> c[i] >> t[i];
  }
  int MAX = 1 << 30;
  int ans = MAX;

  for (int i = 0; i < N; ++i){
    if(t[i] <= T){
      ans = min(ans, c[i]);
      
    }
  }

  if (ans <  MAX){
    cout << ans << endl;
  }
  else {
    cout << "TLE" << endl;
  }
}

Submission status: Runtime Error

Solution code:
#include<iostream>
#include<algorithm>
#include<vector>

using namespace std;

int main(){
  int N, T; cin >> N >> T;
  vector<int> c[i], t[i];
  for(int i = 0, i < N; ++i) {
    cin >> c[i] >> t[i];
  }
  int MAX = 1 << 30;
  int ans = MAX;

  for (int i = 0; i < N; ++i){
    if(t[i] <= T){
      ans = min(ans, c[i]);
      
    }
  }

  if (ans <  MAX){
    cout << ans << endl;
  }
  else {
    cout << "TLE" << endl;
  }
}

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n, T = map(int, input.split())
res = 2000
for _ in range(n):
  c, t = map(int, input.split())
  if t > T: continue
  res = min(res, c)
if res == 2000:
  print('TLE')
else:
  print(res)

Submission status: Runtime Error

Solution code:
I=lambda:map(int,input())
n,k=I()
s=1001
for i in range(n):
  a,b=I()
  if b<=k:
    s=min(s,a)
if s==1001:
  print('TLE')
else:
  print(s)

Submission status: Runtime Error

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

a = []

for i in range(n):
  cost, time = map(int, input().split())
  if time <= t:
    a.append(cost)

a.sort()
print(a[0])

Submission status: Runtime Error

Solution code:
text = input()
textdata = list(map(int, text.split()))
route_num = textdata[0]
time_lim = textdata[1]
candidate = []

for i in range(route_num):
    if textdata[2*(i+1)+1] > time_lim:
        continue
    else:
        candidate += [textdata[2*(i+1)]]
        
if len(candidate)==0:
    print("TLE")
else:
    print("{}".format(min(candidate)))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

minc=1000
for cand in range(N):
    if cand[1]<=T:
        if cand[0]<minc:
            minc=cand[0]
if minc==1000:
    print("TLE")
else:
    print(minc)

Submission status: Runtime Error

Solution code:
from operator import itemgetter

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

a=sorted(a,key=itemgetter(1))

key=0
ans=1001
while a[key][1]<=T:
    ans = min(ans,a[key][0])
    key += 1

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

Submission status: Runtime Error

Solution code:
from operator import itemgetter

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

a=sorted(a,key=itemgetter(1))

key=0
ans=1001
while a[key][1]<=T:
    ans = min(ans,a[key][0])
    key += 1

if key==0:
    print('TLE')
else:
    print(ans)

Submission status: Runtime Error

Solution code:
N, T = raw_input().split()
sct = []
for i in xrange(int(N)):
    ci, ti = raw_input().split()
    if int(ti) <= int(T):
        s = set()
        s.add(ci)
        s.add(ti)
        sct.append(int(ci))
print(min(sct))

Submission status: Runtime Error

Solution code:
N, T = raw_input().split()
sct = []
for i in xrange(int(N)):
    ci, ti = raw_input().split()
    if int(ti) < int(T):
        s = set()
        s.add(ci)
        s.add(ti)
        sct.append(ci)
print(min(sct))

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

cNtN = [[0] * 2 for i in range(N)]
for i in range(N):
    cNtN[i][0], cNtN[i][1] = map(int, input().split())

min_c = float('inf')
for i in range(N):
    if cNtN[i][1] <= T and cNtN[i][0] < min_C:
        min_c = cNtN[i][0]

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

Submission status: Runtime Error

Solution code:
import copy
N, T = map(int, input().split())
ct = {}
for _ in range(N):
  ci, ti = map(int, input().split())
  ct[ci] = ti
  
count = 0
ct2 = copy.deepcopy(ct)
for ci, ti in ct.items():
  if ti > T:
    count += 1
    del ct2[ci]

if count == N:
  print("TLE")
else:
  print(min(ct2.keys()))

Submission status: Runtime Error

Solution code:
import copy
N, T = map(int, input().split())
ct = {}
for _ in range(N):
  ci, ti = map(int, input().split())
  ct[ci] = ti
  
count = 0
ct2 = copy.deepcopy(ct)
for ci, ti in ct.items():
  if ti > T:
    count += 1
    del ct2[ci]

if count == N:
  print("TLE")
  exit()

print(min(ct2.keys()))

Submission status: Runtime Error

Solution code:
n = int(input())
t = int(input())
ans = 1234567
for i in range(n):
    c = int(input())
    if int(input) <= t:
        ans = max(ans,c)

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N, T = map(int, input().split())
A = []
ct = [list(map(int,input().split())) for i in range(N)]
for j in range(N):
    if ct[j][1] <= T and (A[0] >= ct[j][0] or A[0] is None):
        A = [ct[j][0], ct[j][1]]
if A[0] is None:
    print("TLE")
else:
    print(A[0])

Submission status: Runtime Error

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

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

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

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

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

Submission status: Runtime Error

Solution code:
N, T = map(int, input().split())
li = []
try:
  li = [list(map(int, input().split())) for i in range(N)]
except EOFError:
  pass

li2 = [] 

for s in li:
  if s[0:] <= T:
    li2 = li2.append(s)
    for t in li2:
      minli = min(li2[:1])
      print(minli)
      
  else:
    print("TLE")

Submission status: Runtime Error

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

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

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

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

Submission status: Runtime Error

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

for s in li:
  if s[0:] <= T:
    li2 = li2.append(s)
    for t in li2:
      minli = min(li2[:1])
      print(minli)
      
  else:
    print("TLE")

Submission status: Runtime Error

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

if 


for s in li:
  if s[0:] <= T:
    li2 = li2.append(s)
    for t in li2:
      minli = min(li2[:1])
      print(minli)
      
  else:
    print("TLE")

Submission status: Runtime Error

Solution code:
import numpy as np

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

cost = []
time = []

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

if min(time) > timeMax:
    print('TLE')
else :
    print(min(cost))
"""
for i in range(dataNum):
    A, B = list(map(int, input().strip().split(' ')))   
    if B <= timeMax:
        cost.append(A)
        time.append(B)
    
if min(time) > timeMax:
    print('TLE')
else :
    print(min(cost))

Submission status: Runtime Error

Solution code:
N, T = map(int, input().split(" "))
roots = [tuple(map(int, input().split(" "))) for i in range(N)]
roots = sorted(roots, key=lambda x:x[1])

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

ans = 100000000
for i in range(len(roots)):
  csum = dfs(i, 0, 0)
  if ans > csum:
    ans = csum
  if csum == 100000000:
    is_do = False

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

Submission status: Runtime Error

Solution code:
N, T = map(int, input().split())
A = []
B = []
for i in range(N):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)
    i += 1
if T >= min(B):
    for j in range(len(A)-1):
        if B[j] > T:
            A.pop(j)
            B.pop(j)
        else:
            pass
    print(min(A))
else:
    print("TLE")

Submission status: Runtime Error

Solution code:
N, T = map(int, input().split())
A = []
B = []
for i in range(N):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)
    i += 1
print(A,B)
if T >= min(B):
    for j in range(len(A)-1):
        if B[j] > T:
            A.pop(j)
            B.pop(j)
        else:
            pass
    print(min(A))
else:
    print("TLE")

Submission status: Runtime Error

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

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

print(min(c))

Submission status: Runtime Error

Solution code:
import numpy as np
N, T = map(int, input().split()) #代入

li = list(map(int, input().split())) for i in range(N)　#代入、二次元リスト完成
li2 = []

for s in li:
  if s[0:] <= T:
    li2 = li2.append(s)　　　　#li2で列部分がT以下のものを抽出したい

for t in li2:
  minli = min(li2[[:1]])

print(minli)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# cording:utf-8
n,t = (int(x) for x in input().split())
cost_list = list()
time_list = list()
while n >= 1:
    c,tn = (int(x) for x in input().split())
    if tn >= t:
        cost_list.append(c)
        time_list.append(tn)
        n = n - 1
    else:
        n = n - 1
best_time = min(time_list)
if best_time <= t:
    best_time_number = time_list.index(best_time)
    print(cost_list[best_time_number])
else:
    print('TLE')

Submission status: Runtime Error

Solution code:
res = [0,0]
for i in range(n[0]):
    get = input().split(" ")
    get = list(map(int,get))
    

    if get[1] < n[1]:
        res[0] = get[0]
        res[1] = get[1]
    
if res[0]==0 and res[1]==0:
    print('TLE')
else:print(res[0])

Submission status: Runtime Error

Solution code:
N, T = map(int, input().split(" "))
roots = [tuple(map(int, input().split(" "))) for i in range(N)]
roots = sorted(roots, key=lambda x:x[1])

def dfs(i, csum, tsum):
    c, t = roots[i]

    if tsum + t <= T:
        return dfs(i+1, csum+c, tsum+t)
    else:
        return csum

import numpy as np
clist = np.array([dfs(i, 0, 0) for i in range(len(roots))])
nzclist = clist[np.nonzero(clist)]
if len(nzclist) == 0:
    print('TLE')
else:
    print(min(nzclist))

Submission status: Runtime Error

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

best=-1
best_c=-1
for _ in range(N):
    c,t = map(int,input().split())
    if t <= T:
        if best_c == -1:
            best_c = c
        else if best_c > c:
            best_c = c
if best == -1:
    print("TLE")
else: 
    print(best)

Submission status: Runtime Error

Solution code:
import numpy as np
N, T = map(int, input().split())

li = list(map(int, input().split())) for i in range(N)
        
li2 = list(li for t in li[,1] <= T)
      minli = min(li2[0,])
      
print(minli)

Submission status: Runtime Error

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

c = [0 for i in range(N)]
t = [0 for i in range(N)]

count = 0

for i in range(N):
    c[i], t[i] = map(int, input().split())
    
for i in range(N):
    if t[i] > T:
        del c[i]
        count += 1
        
c.sort()

if count != N:
    print(c[0])
else:
    print("TLE")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import numpy as np
N, T = map(int, input().split())

li = [list(map(int, input().split())) for i in range(N)
        
li2 = list[li for t in li[,1] <= T]
      minli = min(li2[0,])
      
print(minli)

Submission status: Runtime Error

Solution code:
N,T=input().split()
min=1001
for i in range(N):
  cost,time=input().split()
  if time<=T and cost<min:
    min=cost
if min==1001:
  print('TLE')
else:
  print(min)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

c = [0 for i in range(N)]
t = [0 for i in range(N)]

for i in range(N):
    c[i], t[i] = map(int, input().split())
    
for i in range(N):
    if t[i] > T:
        del c[i]
        
c.sort()

print(c[0])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import numpy as np
N,T = map(int, input().split())

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

c_list = np.array(c_list)
t_list = np.array(t_list)	

if t_list[t_list<=T]:
	print('TLE')
else:
	print(min(c_list[t_list<=T]))

Submission status: Runtime Error

Solution code:
N, T = map(int, input().split())
cage,cage2=[],[]
for i in range(N):
  c, t = map(int, input().split())
  if t<=T:
	cage.append(c)
    cage2.append(n)
if cage==None:
  print("TLE")
else:
  print(soted(cage)[0])

Submission status: Runtime Error

Solution code:
N, T = map(int, input().split())
cage,cage2=[],[]
for n,i in enumerate(N):
  c, t = map(int, input().split())
  if t<=T:
	cage.append(c)
    cage2.append(n)
if cage==None:
  print("TLE")
else:
  print(soted(cage)[0]

Submission status: Runtime Error

Solution code:
N = int(input())
T = int(input())
d = {}
for i in range(N):
	c = int(input())
	t = int(input())
	d[c] = t
for c, t in sorted(d.items(), key=lambda x: x[0]):
	if t <= T:
		print(c)
		break
else:
	print("TLE")

Submission status: Runtime Error

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

INF = 10001
minimum = INF
for i in range(N):
    c,t = map(int, input())
    if t <= T:
        minimum = min(minimum, c)

if minimum == INF:
    print('TLE')
else
    print(minimum)

Submission status: Runtime Error

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

List = []
 
for _ in range(N):
  list = list(map(int,input().split(' ')))
  List.append(list)
 
List = [x[0] for x in List if x[1]<=T]
  
print(min(List))

Submission status: Runtime Error

Solution code:
4 3
1 1000
2 4
3 1000
4 500

Submission status: Runtime Error

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

for _ in range(N):
  list = list(map(int,input().split(' ')))
  List.append(list)

List = [x[0] for x in List if x[1]<=T]
  
print(min(List))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N, T = [int(i) for i in input().split()]
ans = LTE
for i in range(N):
    c1, c2 = [int(j) for j in input().split()]

    if c2 <= T:
        ans = c1

print(ans)

Submission status: Runtime Error

Solution code:
N, T = map(int, input().split(" "))
roots = [tuple(map(int, input().split(" "))) for i in range(N)]
roots = sorted(roots, key=lambda x:x[1])

ans = 1000000000
for i in range(len(roots)):
  ii = i
  csum = 0
  tsum = 0
  
  while True:
    c, t = roots[ii]
    tsum += t

    if T >= tsum:
      ii += 1
      csum += c
    else:
      break
    
  if ans > csum and csum != 0:
      ans = csum
  else:
      tsum = 0
      break

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

Submission status: Runtime Error

Solution code:
N,T = [int(i) for i in input()]
ans = LTE
for i in range(N):
  c1,c2 = [int(j) for j in input()]
  
  if c2 <= T:
    ans = c1
    
print(ans)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
n, t = split(input())
ret = 1001
for i in range(n):
  a, b = split(input())
  if b <= t:
    ret = min(a, ret)
    
if ret == 1001:
  print('TLE')
else:
  print(ret)

Submission status: Runtime Error

Solution code:
N, T = map(int, input().split())
data = [list(map(int, input().split())) for i in range(N)
        
l = list[s for s in data if data.split([:1]) <= T
     
minl = t for t in min(l.split([0:])
      
print(minl)

Submission status: Runtime Error

Solution code:

import numpy as np
import pandas as pd

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

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

df = pd.DataFrame(dat1)
df = df.astype(np.int64)

lt_T = df[1] < T

ans = df[lt_T].min()[0]

if np.isnan(ans):
    print("TLE")
else:
    print(ans)

Submission status: Runtime Error

Solution code:
n, t = map(int, input().split())
routes = []
for _ in range(n):
  routes.append(tuple(map(int, input().split())))
print(min(route[0] for route in routes if route[1]<t))

Submission status: Runtime Error

Solution code:
n, t = map(int, input().split)
routes = []
for _ in range(n):
  routes.append(tuple(map(int, input().split)))
print(min(route[0] for route in routes if route[1]<t))

Submission status: Runtime Error

Solution code:
N, M = map(int, raw_input().split())
a = []
for i in range(N):
    a.append(map(int, raw_input().split()))

mincost = 10001
minnum = 10000
for i in range(N):
    if a[i][1]>M:
        continue
    else:
        if mincost > a[i][0]:
            mincost = a[i][0]
            minnum = i

print(a[minnum][0])

Submission status: Runtime Error

Solution code:
Base = input().split(" ")
N = int(Base[0])
TL = int(Base[1])
TX = 10000

for i in range(N):
    Roi = input().split(" ")
    Coi = int(Roi[0])
    TLi = int(Roi[1])
    if TL >= TLi:
        if TX >= int(Coi) or i ==0:
            TX = Coi
if TX == 10000:
    print("TLE")
elif:
    print(TX)

Submission status: Runtime Error

Solution code:
n,t = int(input().split())
m = 10000
for i in range(n):
    c,d = int(input().split())
    if d <= t:
        if m > c:
            m = c
if m = 10000:
    print('TLE')
else:
    print(m)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

k=[]

for x in range(n):
  if (int(l[x][1])<t):
    k.append(l[x][0])
    
print(min(k))

Submission status: Runtime Error

Solution code:
n,t=map(int,input().split())
l=[]
m=[]
for i in range(1,n+1):
  p,q=map(int,input().split())
  if q<=t:
    l[i]=p
    m[i]=q
  else:
    pass
if len(l)==0:
  print("TLE")
else:
  print(min(l))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
strN, strT = input().split()
N = int(strN)
max_t = int(strT)

min_cost: int = 0
for i in range(1, N+1):
    str_cost, str_time = input().split()
    cost = int(str_cost)
    t = int(str_time)
    if max_t < t:
        continue
    if min_cost == 0:
        min_cost = cost
    elif min_cost > cost:
        min_cost = cost

if min_cost == 0:
    print('TLE')
else:
    print(min_cost)

Submission status: Runtime Error

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

C = []
for i in range(3):
    c,t = map(int, input().split())
    if t > T:
        pass
    else:
        C.append(c)

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

Submission status: Runtime Error

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

for i in range(n):
    data.append(list(map(int,input().split())))
    
data.sort(key=lambda x:x[1])

pos = 0
for i in range(len(data)):
    if data[i][1] >t:
        pos = i-1
        break
        
if pos==-1:
    print('TLE')
else:
    new = data[:pos]
    new.sort(key=lambda x:x[0])
    print(new[0][0])

Submission status: Runtime Error

Solution code:
n,t=map(int,input().split())
l=[]
m=[]
for i in range(1,n+1):
  p,q=map(int,input().split())
  if q<=t:
    l[i]=p
    m[i]=q
  else:
    pass
if l==[]:
  print("TLE")
else:
  print(min(l))

Submission status: Runtime Error

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

for i in range(n):
    data.append(list(map(int,input().split())))
    
data.sort(key=lambda x:x[1])

pos = 0
for i in range(len(data)):
    if data[i][1] >t:
        pos = i-1
        
if pos==-1:
    print('TLE')
else:
    new = data[:pos]
    new.sort(key=lambda x:x[0])
    print(new[0][0])

Submission status: Runtime Error

Solution code:
n,t=input().split()
n=int(n)
t=int(t)
res=10000
for i in range(n):
  s=input().split()
  if int(s[1])<=T:
    res=min(res,int(s[0]))
if res==10000:
  print("TLE")
else:
  print(res)

Submission status: Runtime Error

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

b = []

for i in range(N):
    if a[i][1] <= T:
        b.append(a[i][0])

print(min(b))

Submission status: Runtime Error

Solution code:
n,t = [x for x in int(input())]
m = 10000
for i in range(n):
    c,d = [x for x in int(input())]
    if d <= t:
        if m > c:
            m = c
if m = 10000:
    print('TLE')
else:
    print(m)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N, T = list(map(int, input().split()))
paris = []
for i in range(N):
  c, t = list(map(int, input().split()))
  if t<=T:
    pairs.append((c, t))
if len(pairs)==0:
  print('TLE')
else:
  print(sorted(pairs, key=lambda p:p[0])[0][0])

Submission status: Runtime Error

Solution code:
N, T = map(int, input().split())
A = []
for i in range(N):
    temp , B = map(int, input().split())
    if B <= T:
        A.append(temp)
if not A:
    print("TLE")
else:
    print(A.min())

Submission status: Runtime Error

Solution code:
import math


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

R = math.inf

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

if R != math.inf:
    print(R)
else:
    print('TLE')

Submission status: Runtime Error

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

min_c = -1
for i in range(T):
    c,t1 = map(int,input().split())
    if t1 <= T:
        if min_c == -1 or min_c > c:
            min_c = c

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

Submission status: Runtime Error

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

c = set()
for i in range(0, N):
    ci, ti = map(int, input().split())
    if ti > T:
        continue
    c.add(ci)

print(min(c))

Submission status: Runtime Error

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

ans = 10 ** 9

for _ in rnage(N):
    a, b = map(int, input().split())
    if b <= T:
        ans = min(ans, b)

if ans == 10 ** 9:
    print('TLE')
else:
    print(ans)

Submission status: Runtime Error

Solution code:
n,t=map(int,input().split())
ct=[list(map(int,input().split())) for _ in range(n)]
mc=100000
for i in range(n):
    if ct[i][1]<=t:
        if ct[i][0]<mc:
            mc=ct[i][0]
if mi==-1:
    print("TLE")
else:
    print(mc)