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())
ct = [list(map(int,input().split())) for _ in range(N)]

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

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

n, t = na()

mincost = 99999999999999
for i in range(n):
    c, u = na()
    if u <= t:
        mincost = min(mincost, c)

if mincost == 99999999999999:
    print("TLE")
else:
    print(mincost)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

ans = float('inf')
flg = False
for c, t in CTs:
    if t <= T:
        flg = True
        ans = min(ans, c)

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

Submission status: Accepted

Solution code:
n, t = map(int, input().split())
a = []
for _ in range(n):
	i, j = map(int, input().split())
	if j <= t:
		a.append(i)
print('TLE' if not len(a) else min(a))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, time = [int(_) for _ in input().split()]
c = []
t = []
for i in range(n):
    ci, ti = [int(_) for _ in input().split()]
    if ti <= time:
        c.append(ci)
        t.append(ti)

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

Submission status: Accepted

Solution code:
import numpy as np

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

cs = []
ts = []
for k in range(n):
    cc, tt = list(map(int,input().split()))
    cs.append(cc)
    ts.append(tt)
    

try:
    print(np.min(np.array(cs)[np.array(ts)<=t]))
except:
    print('TLE')

Submission status: Accepted

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

ans = 10**4

for i in range(n):
    if ct[i][1]<=t:
        ans = min(ans, ct[i][0])

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

Submission status: Accepted

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

ct.sort()

for i in range(N):
    if ct[i][1] <= T:
        print(ct[i][0])
        exit(0)

print("TLE")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

def main():
    n, T = map(int, input().split())
    arrys = [tuple(map(int, input().split())) for _ in range(n)]
    ans = float('inf')
    for arry in arrys:
        c, t = arry
        if t <= T:
            ans = min(ans, c)
    if ans == float('inf'):
        print('TLE')
    else:
        print(ans)
    
if __name__ == '__main__':
    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(ans)
else:
    print("TLE")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, t =  map(int, input().split())
index=0
cost1=[]
cost2=[]
time=[]
while index < n:
    c, t2 = map(int, input().split())
    if t2 < t+1:
        cost1.append(c)
        cost2.append(c)
        time.append(t2)
    index+=1
if cost1==[]:
    print("TLE")
else:
    print(min(cost1))

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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 mc==100000:
    print("TLE")
else:
    print(mc)

Submission status: Accepted

Solution code:
N,T=list(map(int,input().split()))
min_=1111
for i in range(N):
    c,t=list(map(int,input().split()))
    if t <=T:
        if min_>c:
            min_=c
if min_==1111:
    min_='TLE'
print(min_)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

#n=int(input())


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

for _ in range(n):
    c0,t0=[int(i) for i in input().split()]
    if t0 <= T:
        c.append(c0)

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

Submission status: Accepted

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

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

if res == 2e9:
    print('TLE')
else:
    print(res)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 9999999999999999999999999999999999999999999999999999999999999999999999999999
for i in xrange(n):
    c, t = map(int, raw_input().split())
    if t <= T:
        ans = min(ans, c)
if ans > 999999999999999999999999999999999999999999999999999999999999999:
    print "TLE"
else:
    print ans

Submission status: Accepted

Solution code:
n, tt = list(map(int, input().split()))
cs = []

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

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

Submission status: Accepted

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

result = 1010

for i in range(N):
    c, t = [int(_) for _ in input().split()]
    if t <= T:
        result = min(c, result)

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

Submission status: Accepted

Solution code:
def inpl(): return list(map(int, input().split()))

N, T = inpl()
ans = 10**9
for _ in range(N):
    c, t = inpl()
    if t <= T:
        ans = min(ans, c)

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

Submission status: Accepted

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

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

Submission status: Accepted

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

res = float("inf")
for i in array:
    if i[1] <= t:
        res = min(res, i[0])
print(res if res != float("inf") else "TLE")

Submission status: Accepted

Solution code:
ai = lambda: list(map(int,input().split()))
ai_ = lambda: [int(x)-1 for x in input().split()]

n,T = ai()
ans = 10**5
for _ in range(n):
    c,t = ai()
    if t <= T:
        ans = min(c,ans)
if ans == 10**5:
    print('TLE')
else:
    print(ans)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

C.sort()

for c, s in C:
    if s <= t:
        print(c)
        exit()

print('TLE')

Submission status: Accepted

Solution code:
N,T=list(map(int, input().strip().split()))
m=999999
for i in range(N):
    c,t=list(map(int, input().strip().split()))
    if t<=T:
        if m>c:
            m=c
if m>1000:
    print("TLE")
else:
    print(m)

Submission status: Accepted

Solution code:
n, t = map(int, input().split())
c = 10000
for i in range(n):
    a, b = map(int, input().split())
    if t >= b and c > a:
        c = a
if c == 10000:
    print("TLE")
else:
    print(c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, T = map(int, input().split())
num = float("inf")
for i in range(N):
    c, t = map(int, input().split())
    if t <= T:
        num = min(num, c)

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

Submission status: Accepted

Solution code:
n,t = map(int, input().split())
list_ct = []
c_min = 10000000
for i in range(n):
    list_ct.append(list(map(int, input().split())))
for i in range(n):
    if list_ct[i][1] <= t:
        if c_min > list_ct[i][0]:
            c_min = list_ct[i][0]

if c_min == 10000000:
    print("TLE")
else:
    print(c_min)

Submission status: Accepted

Solution code:
n,t = map(int,input().split())
ass = []
for i in range(n):
    x,y = map(int,input().split())
    if y <= t:
        ass.append(x)
if len(ass)>=1:
    print(min(ass))
else:
    print('TLE')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#N = int(input())
#a = [int(i) for i in input().split()]
#s = [[int(j) for j in input().split()] for i in range(N)]


N,T = [int(i) for i in input().split()]
CT = [[int(j) for j in input().split()] for i in range(N)]
res = 10**10
for c,t in CT:
    if t<=T:
        res=min(res,c)
if res==10**10:
    print("TLE")
else:
    print(res)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
from sys import stdin

s_in = lambda: stdin.readline()[:-1] # s = s_in()
d_in = lambda: int(stdin.readline()) # N = d_in()
ds_in = lambda: list(map(int, stdin.readline().split())) # List = ds_in()

N, T = ds_in()
cmin = 10**10

for _ in range(N):
    c, t = ds_in()
    if t <= T:
        cmin = min(cmin, c)

if cmin == 10**10:
    print('TLE')
else:
    print(cmin)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
il = lambda func=int: list(map(func, stdin.readline().rstrip().split()))
ils = lambda n, s="int(input())": [eval(s) for _ in range(n)]

n, t = il()
l = ils(n, "il()")
l.sort(key=lambda x:x[1])
ans = 100000
for a, b in l:
    if b > t:
        break
    ans = min(ans, a)
print("TLE" if ans == 100000 else ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

LIST=[]
for i in ct:
    if i[1]<=T:
        LIST.append(i[0])

if LIST==[]:
    print("TLE")

else:
    LIST.sort()
    print(LIST[0])

Submission status: Accepted

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

Submission status: Judge Not Available

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

under_t = (index for index,i in enumerate(t) if i <= T)
a = 0
for i in under_t:
  a += 1

if a == 0:
  print('TLE')
else:  
  result = sorted(n[i] for i in under_t)[0]
  print(result)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n,T=map(int,input().split())
c=[0]*n
t=[0]*n
ans=[]
for i in range(n):
    c[i],t[i]=map(int,input().split())
    if t[i]<=T:
        ans.append(c[i])
print(min(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)
print(min(l))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n, t = map(int, input().split())
a = [list(map(int, input().split())) for i in range(n)]
l = []
flag = False
for i in range(n):
    if a[i][2] <= t:
        l.append(a[i][0])
        flag = True
if flag:
    print(min(l))
else:
    print('TLE')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n,T=map(int,input().split())
c=list(map(int,input().split('\n')))
k=1000
l=1
for i in range(n):
    if c[i][1] <= T:
        l=0
        if c[i][0] < k:
            k = c[i][0]
if l==1:
    print('TLE')
else:
    print(k)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b=input().split()
a=int(a)
b=int(b)
c=[input().split() for i in range(a)]
d=1001
for i in range(a):
  if int(c[i][i])<=b:
    if d>int(c[i][i]):
      d=int(c[i][i])
print(d)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

max_cost = 10 ** 9

for _ in range(n):
  c, tt = map(int, input().split())
  if tt <= t:
    max_cost = max(max_cost, c)
    
print(max_cost)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

m = 1001

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

Submission status: Runtime Error

Solution code:
a,b=map(int,inpu().split())
meta = int(a)
for i in range(a):
  x,y = map(int,input().split())
  if b > y and a > x:
    a = x
if meta > a:
  print(a)
else:
  print("TLE")

Submission status: Runtime Error

Solution code:
a,b=map(int,inpu().split())
x,y = [list(map(int,input().split())) for i in range(a)]
if b < max(y):
  print("TLE")
else:
  for i in range(a):
    if b > y[i] and a > x[i]:
      a = x[i]
  print(a)

Submission status: Runtime Error

Solution code:
a,b=map(int,inpu().split())
x,y = [list(map(int,input().split())) for i in range(a)]
for i in range(a):
  if b > y[i] and a > x[i]:
    a = x[i]
print(a)

Submission status: Runtime Error

Solution code:
n, t = map(int, input().split())
c_lists = []
t_lists = []
for i in range(n):
  c_i, t_i = map(int, input().split())
  c_lists.append(c_i)
  t_lists.append(t_i)

costs = []
for j in range(n):
    if t_lists[j] <= t:
        costs.append(c_lists[j])
if not costs:
    ans = 'TLE'
else:
    minimum = costs[0]
    for k in costs:
        if k < minimum:
            minimum = k
            ans = k
print(ans)

Submission status: Runtime Error

Solution code:
n, t = map(int, input().split())
c_lists = []
t_lists = []
for i in range(n):
  c_i, t_i = map(int, input().split())
  c_lists.append(c_i)
  t_lists.append(t_i)

costs = []
for j in range(n):
    if t_lists[j] <= t:
        costs.append(c_lists[j])
if costs == []:
    ans = 'TLE'
else:
    minimum = costs[0]
    for k in costs[1:]:
        if k < minimum:
            minimum = k
            ans = k
print(ans)

Submission status: Runtime Error

Solution code:
n, t = map(int, input().split())
c_lists = []
t_lists = []
for i in range(n):
  c_i, t_i = map(int, input().split())
  c_lists.append(c_i)
  t_lists.append(t_i)

costs = []
for j in range(n):
    if t_lists[j] <= t:
        costs.append(c_lists[j])
if costs == []:
    ans = 'TLE'
else:
    minimum = costs[0]
    for k in costs:
        if k < minimum:
            minimum = k
            ans = k
print(ans)

Submission status: Runtime Error

Solution code:
n, t = map(int, input().split())
c_lists = []
t_lists = []
for i in range(n):
  c_i, t_i = map(int, input().split())
  c_lists.append(c_i)
  t_lists.append(t_i)

indexes = []
index = 0
for i in t_lists:
    if i <= t:
        indexes.append(index)
    index += 1
costs = []
for i in indexes:
    costs.append(c_lists[i])

if costs == []:
    ans = 'TLE'
else:
    minimum = costs[0]
    for i in costs:
        if i < minimum:
            minimum = i
            ans = minimum

print(ans)

Submission status: Runtime Error

Solution code:

n,T = map(int,input().split())
ct = [list(map(int,input().split())) for _ in range(n)]
li = []
for k in ct:
    if k[1]<=T:
        li += [k[0]]
print(min(li))

Submission status: Runtime Error

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

for i in range(n):
    a,b=map(int,input().strip().split(" "))
    if b<=t:
        c.append(a)
print(min(c))

Submission status: Runtime Error

Solution code:
N,T=map(int,input().split())
ct=[0]*N
cost=[]
for i in range(N):
  ct[i]=list(map(int,input().split()))
  if ct[i][1]<T :
    cost.append(ct[i][0])
print(min(cost))

Submission status: Runtime Error

Solution code:
n, t = map(int, input().split())
ans =[]
for i in range(n):
  a, b = map(int, input().split())
  if b <= t:
    ans.append(a)
print(min(ans))

Submission status: Runtime Error

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

ct = [i[0] for i in ct if i[1]<=t]
print(min(ct))

Submission status: Runtime Error

Solution code:
# abc112_b.py
# https://atcoder.jp/contests/abc112/tasks/abc112_b

# B - Time Limit Exceeded /
# 実行時間制限: 2 sec / メモリ制限: 1024 MB
# 配点 : 200点

# 問題文
# 外出している X さんは、ABC に参加するためにスマートウォッチで最適な帰宅経路を調べることにしました。
# スマートウォッチであるあなたは、N個の帰宅経路を見つけました。
# X さんが i番目の経路を使う場合、コスト ci かけて時間 tiで帰宅できます。
# 時間 T以内に帰宅できる経路のうち、コストが最小となる経路のコストを求めてください。

# 制約
#     入力はすべて整数である
#     1≤N≤100
#     1≤T≤1000
#     1≤ci≤1000
#     1≤ti≤1000
#     各 (ci,ti)の組は異なる

# 入力
# 入力は以下の形式で標準入力から与えられる。
# N T
# c1 t1
# c2 t2
# :
# cN tN

# 出力
# 時間 T以内に帰宅できる経路のうち、コストが最小となる経路のコストを出力せよ。
# ただし、どの経路を使っても時間 T以内に帰宅できない場合、TLE と出力せよ。

# 入力例 1
# 3 70
# 7 60
# 1 80
# 4 50

# 出力例 1
# 4

# 1番目の経路を使うと、コスト 7で帰宅できます
# 2番目の経路では時間 T=70以内に帰宅できません
# 3番目の経路を使うと、コスト 4で帰宅できます
# 従って、3番目の経路を使ったときのコスト 4が最小です。

# 入力例 2
# 4 3
# 1 1000
# 2 4
# 3 1000
# 4 500

# 出力例 2
# TLE

# どの経路を使っても時間 T=3以内に帰宅できません。

# 入力例 3
# 5 9
# 25 8
# 5 9
# 4 10
# 1000 1000
# 6 1

# 出力例 3
# 5


def calculation(lines):
    # N = int(lines[0])
    N, T = list(map(int, lines[0].split()))
    # n = lines[0]

    min_c = None

    for i in range(1, N+1):
        c, t = list(map(int, lines[i].split()))
        if t <= T:
            if min_c is None:
                min_c = c
            elif min_c > c:
                min_c = c

    if min_c is None:
        return ['TLE']
    else:
        return [min_c]


# 引数を取得
def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines


# テストデータ
def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['3 70', '7 60', '1 80', '4 50']
        lines_export = [4]
    if pattern == 2:
        lines_input = ['4 3', '1 1000', '2 4', '3 1000', '4 500']
        lines_export = ['TLE']
    if pattern == 3:
        lines_input = ['5 9', '25 8', '5 9', '4 10', '1000 1000', '6 1']
        lines_export = [5]
    return lines_input, lines_export


# 動作モード判別
def get_mode():
    import sys
    args = sys.argv
    if len(args) == 1:
        mode = 0
    else:
        mode = int(args[1])
    return mode


# 主処理
def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(2)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    # if mode > 0:
    #     print(f'lines_input=[{lines_input}]')
    #     print(f'lines_export=[{lines_export}]')
    #     print(f'lines_result=[{lines_result}]')
    #     if lines_result == lines_export:
    #         print('OK')
    #     else:
    #         print('NG')
    # finished = time.time()
    # duration = finished - started
    # print(f'duration=[{duration}]')


# 起動処理
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
n,t=map(int,input().split())
li=[]
for i in range(n):
  c,tt=map(int,input().split())
  if tt>t:
    continue
  li.append(c)
print(min(li))

Submission status: Runtime Error

Solution code:
# https://atcoder.jp/contests/abc087/tasks/abc087_a
# 2020/07/04
def main():
    X, A, B = [int(input()) for _ in range(3)]
    remain = X - A
    print(remain % B)

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


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
N, T = map(int, input().split())
X = [list(map(int, input().split())) for _ in range(N)]
Y = [X[i] if X[i][1]<=T for i in range(N)]
print(Y)

Submission status: Runtime Error

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

for c, t in map(int, input().split()):
  if T < t:
    continie
  if c < min_c:
    min_c = c

print(c)

Submission status: Runtime Error

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

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

if ans_t == 1001:
    print("TLE")
else:
    print(ans_c)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N, T = map(int, input().split())
c_t = [list(map(int, input().split())) for _ in range(N)]
cost = 2_000_000
TLE_flg = True
for i in range(N):
    if c_t[i][1] <= T:
        cost = min(cost, c_t[i][0])
        TLE_flg = False
print('TLE' if TLE_flg else cost)

Submission status: Runtime Error

Solution code:
N, T = map(int, input().split())
cost = 2_000_000
TLE_flg = True
for _ in range(N):
    c, t = map(int, input().split())
    if t <= T:
        cost = min(cost, c)
        TLE_flg = False
print('TLE' if TLE_flg else cost)

Submission status: Runtime Error

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

min = 1000
for i in range(n):
    c,t = map(int,input().split())
    if T > t[i] and min > c[i]:
        min = c[i]
if min ==1000:
    print('TLE')
else:
    print(min)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n= int(input())
T = int(input())
c = list(input().split())
t = list(input().split())
min = 1000
for i in range(n):
    if int(T) > int(t[i]) and min > int(c[i]):
        min = int(c[i])
if min ==1000:
    print('TLE')
else:
    print(min)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

for i in range(N):
    C.append([int(i) for i in input().split()])

min = T
res = []

for c in C:
    cost = c[0]
    time = c[1]
    if time <= min:
        res.append(cost)
    

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n,t=map(int,input().split())
x=[]
for i in range(n):
  c,d=map(int,input().split())
  if d<=t:
    x+=c
print(min(x))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N,T = list(map(int,input().split()))
c = [None for _ in range(N)]
t = [None for _ in range(N)]
A = [None for _ in range(N)]
for i in range(N):
  c[i], t[i] = input().split()
  c[i] = int(c[i])
  t[i] = int(t[i])
for i in range(N):
  if t[i] <= T:
    A[i] = c[i]
A = [a for a in A if type(a) != 'Nonetype']
A = sorted(A)
ans = A[0]
print(ans)