ZhenlongDai/ACPR huggingface dataset:
Problem: p02995
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import fractions
def lcm(x, y):
    return (x * y) 

A,B,C,D = map(int,input().split())

a = int(B/C) - int((A-1)/C)
b = int(B/D) - int((A-1)/D)
c = int(B/lcm(C,D)) - int((A-1)/lcm(C, D))

print ( B - (A - 1) - (a + b - c))

Failing test case input:
8489283863195222 4466928324079138 259 16098586728

Expected output:
-4006825208606121


Actual output:
-4006825208600333


Fixed submission (verdict: Accepted):
import fractions
def lcm(x, y):
    return (x * y) 

A,B,C,D = map(int,input().split())

a = int(B
b = int(B
c = int(B

count = B - (A - 1) - (a + b - c)
print(count)

Problem: p02995
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
a, b, c, d = map(int, input().split())

def gcd(a, b):
  while b:
    a, b = b, a%b
  return a

def count(a, c, d):
    tmp_a= a - math.floor(a/c) - math.floor(a/d)
    tmp_a += math.floor(a/((c*d)/gcd(c, d)))
    return tmp_a

print(count(b,c,d)-count(a-1, c, d))

Failing test case input:
4445144871656471 60117910912501884 8 85843371

Expected output:
48713669718268193


Actual output:
48713669718268192


Fixed submission (verdict: Accepted):
import math
from decimal import Decimal

a, b, c, d = map(Decimal, input().split())

def gcd(a, b):
  while b:
    a, b = b, a%b
  return a

def count(a, c, d):
    tmp_a= a - math.floor(a/c) - math.floor(a/d)
    tmp_a += math.floor(a/((c*d)/gcd(c, d)))
    return tmp_a

print(int(count(b,c,d))-int(count(a-1, c, d)))

Problem: p02995
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B,C,D=map(int,input().split())
listA=range(A)
listB=range(B+1)
listC=range(0,B+1,C)
listAC=range(0,A,C)
listD=range(0,B+1,D)
listAD=range(0,A,D)
listCD=range(0,B+1,C*D)
listACD=range(0,A,C*D)
lenA=len(listA)
lenB=len(listB)
lenC=len(listC)
lenAC=len(listAC)
lenD=len(listD)
lenAD=len(listAD)
lenCD=len(listCD)
lenACD=len(listACD)
ans=lenB-lenA-lenC+lenAC-lenD+lenAD+lenCD-lenACD
print(ans)

Failing test case input:
2 40 8 8

Expected output:
34


Actual output:
29


Fixed submission (verdict: Accepted):
import fractions
A,B,C,D=map(int,input().split())
listA=range(A)
listB=range(B+1)
listC=range(0,B+1,C)
listAC=range(0,A,C)
listD=range(0,B+1,D)
listAD=range(0,A,D)
listCD=range(0,B+1,C*D
listACD=range(0,A,C*D
lenA=len(listA)
lenB=len(listB)
lenC=len(listC)
lenAC=len(listAC)
lenD=len(listD)
lenAD=len(listAD)
lenCD=len(listCD)
lenACD=len(listACD)
ans=lenB-lenA-lenC+lenAC-lenD+lenAD+lenCD-lenACD
print(ans)
Problem: p02995
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

def gcd(a, b):
    while b != 0:
        a, b = b, a % b
    return a

 
def lcm(a, b):
    return a*b

S = input().split()
A = int(S[0])
B = int(S[1])
C = int(S[2])
D = int(S[3])

E = lcm(C,D)

X = int(B/C)-int((A-1)/C)
Y = int(B/D)-int((A-1)/D)
Z = int(B/E)-int((A-1)/E)

print(B-A+1-X-Y+Z)



Failing test case input:
2755958446070485 170847880819691070 32 109641300

Expected output:
162839048457975697


Actual output:
162839048314246848


Fixed submission (verdict: Accepted):

def gcd(a, b):
    while b != 0:
        a, b = b, a % b
    return a

 


def lcm(a, b):
    return a*b


S = input().split()
A = int(S[0])
B = int(S[1])
C = int(S[2])
D = int(S[3])

E = lcm(C, D)

X = int(B
Y = int(B
Z = int(B

print(B-A+1-X-Y+Z)

Problem: p02995
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import fractions
a,b,c,d = map(int, input().split())

def lcm(a,b):
    return a * b / fractions.gcd(a, b)

def count(num, a, b):
    return num - num

print(int(count(b,c,d)-count(a-1,c,d)))


Failing test case input:
11519628362605307 5772277299890772 391 5732805158

Expected output:
-5732651954137286


Actual output:
0


Fixed submission (verdict: Accepted):
import fractions
a,b,c,d = map(int, input().split())

def lcm(a,b):
    return a * b 

def count(num, a, b):
    return int(num - num

print(count(b,c,d)-count(a-1,c,d))

Problem: p02995
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, c, d = map(int,input().split())
import fractions
ans = b - b
print(ans)

Failing test case input:
4445144871656471 29010616170026159 8 109641300

Expected output:
21494787274046937


Actual output:
0


Fixed submission (verdict: Accepted):
a, b, c, d = map(int,input().split())
import fractions
ans = (b - b
print(ans)

Problem: p02995
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c,d=map(int,input().split())
bc=b
if a%c==0:
    ac=a
else:
    ac=a
bd=b
if a%d==0:
    ad=a
else:
    ad=a
e=c
f=d
while f:
    e, f = f, e % f
gcd=e
l=c*d/gcd
bl=b
if a%l==0:
    al=a
else:
    al=a
print(int(b-a+1-(bc-ac+bd-ad-bl+al)))

Failing test case input:
13 40 14 8

Expected output:
22


Actual output:
1


Fixed submission (verdict: Accepted):
a,b,c,d=map(int,input().split())
bc=int(b
if a%c==0:
    ac=int(a
else:
    ac=int(a
bd=b
if a%d==0:
    ad=int(a
else:
    ad=int(a
e=c
f=d
while f:
    e, f = f, int(e % f)
gcd=int(e)
l=int(c*d/gcd)
bl=int(b
if a%l==0:
    al=int(a
else:
    al=int(a
s=int(b-a+1)
s2=int(bc-ac+bd-ad-bl+al)
print(s-s2)

Problem: p02995
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
def gcd(x,y):
  while y:
    x,y = y,x%y
  return x

A,B,C,D = map(int,input().split())
lcm = C*D 
print(B-A-int(B/C-A/C)-int(B/D-A/D)+int(B/lcm-A/lcm))

Failing test case input:
4799622382541550 38464981823067483 7 46883758

Expected output:
28856021762113509


Actual output:
28856021762113507


Fixed submission (verdict: Accepted):
def gcd(x,y):
  while y:
    x,y = y,x%y
  return x

def calc(x,a,b,l):
  return x - (x

A,B,C,D = map(int,input().split())
lcm = C*D 
print(calc(B,C,D,lcm) - calc(A-1,C,D,lcm))
Problem: p02995
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)
def lcm(a, b):
    return a * b / gcd(a,b)
a,b,c,d = map(int,input().split())
canC = int(b/c - (a-1)/c)
canD = int(b/d - (a-1)/d)
dbCD = int(b/lcm(c,d) - (a-1)/lcm(c,d))
print((b-a+1) -canC - canD + dbCD)


Failing test case input:
10 40 6 8

Expected output:
23

Actual output:
24


Fixed submission (verdict: Accepted):

def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)
def lcm(a, b):
    return a * b 
a,b,c,d = map(int,input().split())
canC = int(b
canD = int(b
dbCD = int(b
print((b-a+1) -canC - canD + dbCD)

Problem: p02995
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B, C, D =map(int,input().split())

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def lcm(a, b):
    return a * b 

N_C = (B-A) 
N_D = (B-A) 
N_CD = (B-A) 

ans = (B-A)-N_C-N_D+N_CD
print(ans)

Failing test case input:
4445144871656471 60117910912501884 8 85843371

Expected output:
48713669718268193


Actual output:
0


Fixed submission (verdict: Accepted):
A, B, C, D =map(int,input().split())

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def lcm(a, b):
    return a * b 

ans =(B-A+1)-(B
print(ans)

Problem: p02995
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import fractions

a,b,c,d=map(int, input().split())

def lcm(x, y):
    return (x * y) 

x =int(b/c)-int((a/c))
y =int(b/d)-int((a/d))
n =lcm(c,d)
xy=int(b/n)-int((a/n))

ans = (b-a+1) - (x+y-xy)
print(ans)

Failing test case input:
4445144871656471 60117910912501884 8 85843371

Expected output:
48713669718268193


Actual output:
48713669718268192


Fixed submission (verdict: Accepted):
import fractions
 
a,b,c,d=map(int, input().split())
 
def lcm(x, y):
    return (x * y) 
 
x =(b
y =(b
n =lcm(c,d)
xy=(b
 
ans = (b-a+1) - (x+y-xy)
print(ans)

Problem: p02995
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, c, d = map(int, input().split())

def wareruzu(x):
    start_a = a if a % x == 0 else a - (a % x) + x
    end_b = b - (b % x)
    m = end_b - start_a
    return int(m / x) + 1

all_n = b - a + 1
print(all_n - wareruzu(c) - wareruzu(d) + wareruzu(c*d))

Failing test case input:
5292456474884197 170847880819691070 33 109641300

Expected output:
160538591931352243


Actual output:
160538591839838716


Fixed submission (verdict: Accepted):
import fractions
a, b, c, d = map(int, input().split())
 
def wareruzu(x):
    if b < x:
        return 0
    if b == x:
        return 1
    start_a = a if a % x == 0 else a - (a % x) + x
    end_b = b - (b % x) 
    m = end_b - start_a
    if m < 0:
        return 0
    return int(m 
 
all_n = b - a + 1
print(all_n - wareruzu(c) - wareruzu(d) + wareruzu((c*d)
Problem: p02995
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
import fractions
a,b,c,d=list(map(int,input().split()))
a-=1
s=math.floor(b/c)-math.floor(a/c)
e=math.floor(b/d)-math.floor(a/d)
count=b-a-s-e
def lcm(x, y):
    return (x * y) 
    


com=lcm(c, d)
tmp=math.floor(b/com)-math.floor(a/com)
print(count+tmp)

Failing test case input:
2 40 8 8

Expected output:
34


Actual output:
29


Fixed submission (verdict: Accepted):
import math
import fractions
a,b,c,d=list(map(int,input().split()))
a-=1
calc_c=(b-b
calc_d=(b-b
count=calc_c+calc_d
def lcm(x, y):
    
    return math.floor((x * y) /fractions.gcd(x, y))


com=lcm(c, d)
tmp=(b-b
print(count-tmp)

Problem: p02995
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c,d=map(int,input().split())
bc=b
if a%c==0:
    ac=a
else:
    ac=a
bd=b
if a%d==0:
    ad=a
else:
    ad=a
e=c
f=d
while f:
    e, f = f, e % f
gcd=e
l=c*d/gcd
bl=b
if a%l==0:
    al=a
else:
    al=a
s=b-a+1
s2=int(bc-ac+bd-ad-bl+al)
print(s-s2)

Failing test case input:
2755958446070485 170847880819691070 46 109641300

Expected output:
164437748681656242


Actual output:
1


Fixed submission (verdict: Accepted):
a,b,c,d=map(int,input().split())
bc=int(b
if a%c==0:
    ac=int(a
else:
    ac=int(a
bd=b
if a%d==0:
    ad=int(a
else:
    ad=int(a
e=c
f=d
while f:
    e, f = f, int(e % f)
gcd=int(e)
l=int(c*d/gcd)
bl=int(b
if a%l==0:
    al=int(a
else:
    al=int(a
s=int(b-a+1)
s2=int(bc-ac+bd-ad-bl+al)
print(s-s2)

Problem: p02995
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
a,b,c,d= map(int,input().split())
k=b-a+1
n1=b
n2=a
m1=b
m2=a
def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a
def lcm(a,b):
     return a*b
l1=b
l2=a
n=n1-n2
m=m1-m2
l=l1-l2
print(k+l-n-m)

Failing test case input:
8489283863195222 4466928324079138 259 8563039418

Expected output:
-4006825208381305


Actual output:
1


Fixed submission (verdict: Accepted):
a,b,c,d= map(int,input().split())
k=b+1-a
n=(b
m=(b
def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a
def lcm(a,b):
     return a*b
l=(b
print(k+l-n-m)
Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, t = map(int, input().split())
ct = [list(map(int,input().split())) for _ in range(n)]

li = []
for i in range(n):
  if ct[i][1] < t:
    li.append(ct[i])
  else:
    continue

if len(li) > 0:
  li2 = []
  for i in range(len(li)):
    li2.append(li[i][0])
  print(min(li2))
else:
  print("TLE")

Failing test case input:
5 9
25 8
5 9
4 10
1000 1000
6 1

Expected output:
5

Actual output:
6


Fixed submission (verdict: Accepted):
n, t = map(int, input().split())
ct = [list(map(int,input().split())) for _ in range(n)]

li = []
for i in range(n):
  if ct[i][1] <= t:
    li.append(ct[i])
  else:
    continue

if len(li) > 0:
  li2 = []
  for i in range(len(li)):
    li2.append(li[i][0])
  print(min(li2))
else:
  print("TLE")

Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, T = map(int, input().split())

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

Failing test case input:
5 9
25 8
5 9
4 10
1000 1000
6 1

Expected output:
5

Actual output:
6


Fixed submission (verdict: Accepted):
N, T = map(int, input().split())

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

Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,T=map(int, input().split())
R=[999999999]
for i in range(N):
  c,t=map(int, input().split())
  if T>t:
    R.append(c)
    
print('TLE' if len(R)==1 else min(R))

Failing test case input:
5 9
25 8
5 9
4 10
1000 1000
6 1

Expected output:
5

Actual output:
6


Fixed submission (verdict: Accepted):
N,T=map(int, input().split())
R=[999999999]
for i in range(N):
  c,t=map(int, input().split())
  if T>=t:
    R.append(c)
    
print('TLE' if len(R)==1 else min(R))

Problem: p03239
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
def p_b():
    N, T = map(int, input().split())
    ans = 10 ** 9
    for _ in range(N):
        c, t = map(int, input().split())
        if t <= T:
            ans = min(ans, c * t)
    print(ans if ans != 10 ** 9 else "TLE")
    
p_b()

Failing test case input:
5 9
3 8
5 9
4 10
0100 1000
6 1

Expected output:
3


Actual output:
6


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

Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,t=map(int,input().split())

r=t+100000000000000000000000000000

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


Failing test case input:
4 0
0 0100
-1 6
1 1010
6 -1

Expected output:
6


Actual output:
TLE


Fixed submission (verdict: Accepted):
n,t=map(int,input().split())

r=2000

for _ in range(n):
  a,b=map(int,input().split())
  if b<=t and a<r:
    r=a
if r==2000:
  print("TLE")
else:
  print(r)
Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, T = list(map(int, input().split()))
ans = 10000
for i in range(n):
    c, t = list(map(int, input().split()))
    if t > T:
        continue
    else:
        ans = min(ans, c)
print(ans)


Failing test case input:
-5 -8
0 0100
1 1
4 1100
6 45

Expected output:
TLE


Actual output:
10000


Fixed submission (verdict: Accepted):
n, T = list(map(int, input().split()))
ans = 10000
for i in range(n):
    c, t = list(map(int, input().split()))
    if t > T:
        continue
    else:
        ans = min(ans, c)
if ans == 10000:
    print('TLE')
else:
    print(ans)

Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,T = map(int,input().split())
CT = []
for n in range(N):
  c,t = map(int,input().split())
  CT.append([c,t])
CT = sorted(CT,key=lambda x: x[0])
for ct in CT:
  if ct[1] <= T:
    print(ct[0])
    break


Failing test case input:
-2 -4
0 0101
1 -1
2 0001
3 14

Expected output:
TLE


Actual output:

Fixed submission (verdict: Accepted):
N,T = map(int,input().split())
CT = []
for n in range(N):
  c,t = map(int,input().split())
  CT.append([c,t])
CT = sorted(CT,key=lambda x: x[0])
ans = True
for ct in CT:
  if ct[1] <= T:
    print(ct[0])
    ans = False
    break
if ans:
  print("TLE")

Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, T = map(int, input().split())

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

Failing test case input:
-4 -2
0 0100
1 0
2 0001
3 31

Expected output:
TLE


Actual output:
1000


Fixed submission (verdict: Accepted):
N, T = map(int, input().split())

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

Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,K=[int(s) for s in input().split()]
n=10000
for i in range(N):
  a,b=[int(s) for s in input().split()]
  if b<=K:
    n=min([n,a])
if n==10000:
  print("TLE")
else:
  print(a)
    


Failing test case input:
3 36
7 94
2 2
7 50

Expected output:
2


Actual output:
7


Fixed submission (verdict: Accepted):
N,K=[int(s) for s in input().split()]
n=10000
for i in range(N):
  a,b=[int(s) for s in input().split()]
  if b<=K:
    n=min([n,a])
if n==10000:
  print("TLE")
else:
  print(n)

Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,t = map(int,input().split())
lis = [list(map(int, input().split())) for _ in range(n)]
minCost = float("inf")
for i in lis:
    if i[1] < t:
        if i[0] < minCost:
            minCost = i[0]
print(minCost)

Failing test case input:
-1 0
0 0001
1 0
2 0001
2 14

Expected output:
TLE


Actual output:
inf


Fixed submission (verdict: Accepted):
n,t = map(int,input().split())
lis = [list(map(int, input().split())) for _ in range(n)]
minCost = float("inf")
cnt = 0
for i in lis:
    if i[1] <= t:
        if i[0] < minCost:
            minCost = i[0]
            cnt += 1
if cnt != 0:  
    print(minCost)
else:
    print('TLE')
Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, T = [int(i) for i in input().split()]
ct = []
for j in range(N):
  ct.append([int(i) for i in input().split()])
ct.sort()
flag = 0
for i in range(N):
  if ct[i][1] < T:
    print(ct[i][0])
    flag = 1
    break
if flag == 0:
  print("TLE")

Failing test case input:
5 9
25 8
5 9
4 10
0100 1000
6 1

Expected output:
5


Actual output:
6


Fixed submission (verdict: Accepted):
N, T = [int(i) for i in input().split()]
ct = []
for j in range(N):
  ct.append([int(i) for i in input().split()])
ct.sort()
flag = 0
for i in range(N):
  if ct[i][1] <= T:
    print(ct[i][0])
    flag = 1
    break
if flag == 0:
  print("TLE")

Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,T=map(int,input().split())
min=1001
for i in range(N):
    c,t=map(int,input().split())
    if t<(T+1):
        if c<min:
            min=c
print(min)            
    


Failing test case input:
-4 -2
0 0100
1 0
1 0001
3 31

Expected output:
TLE


Actual output:
1001


Fixed submission (verdict: Accepted):
N,T=map(int,input().split())
min=1001
for i in range(N):
    c,t=map(int,input().split())
    if t<(T+1):
        if c<min:
            min=c           
if min==1001:
    print("TLE")
else:
    print(min)

Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
NT = input()
NT = NT.split()
N = int(NT[0])
T = int(NT[1])

ct = []
for i in range(N):
    ct_input = input()
    ct.append(ct_input)
    
t = 1000
c = 1000
flag = True

for i in range(N):
    cti = ct[i]
    cti = cti.split()
    ci = int(cti[0])
    ti = int(cti[1])
    if t >= ti and T >= ti:
        t = ti
        flag = False
        if c >= ci:
             c = ci



if flag == True:
    print("TLE")
else:
    print(ci)


Failing test case input:
3 36
7 94
2 2
7 50

Expected output:
2


Actual output:
7


Fixed submission (verdict: Accepted):
NT = input()
NT = NT.split()
N = int(NT[0])
T = int(NT[1])

ct = []
for i in range(N):
    ct_input = input()
    ct.append(ct_input)
    

flag = True
cost = 1000
for i in range(N):
    cti = ct[i]
    cti = cti.split()
    ci = int(cti[0])
    ti = int(cti[1])
    if T < ti:
        continue
    if cost >= ci:
        cost = ci
        flag = False



if flag == True:
    print("TLE")
else:
    print(cost)

Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
d = list(map(int,(input().strip().split(' '))))
N = d[0]
T = d[1]
min = 100000000
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 == 100000000:
    print("TLE")
else:
    print(min)


Failing test case input:
2 3
1 1100
2 1
3 0011
4 156

Expected output:
2


Actual output:
TLE


Fixed submission (verdict: Accepted):
d = list(map(int,(input().strip().split(' '))))
N = d[0]
T = d[1]
min = 100000000
for i in range(0, N):
    d = list(map(int,input().strip().split(' ')))
    c = d[0]
    t = d[1]
    if t <= T:
        if min >= c:
            min = c
if min == 100000000:
    print("TLE")
else:
    print(min)
Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)

Failing test case input:
5 9
25 8
5 9
4 10
0000 1000
6 1

Expected output:
5


Actual output:
6


Fixed submission (verdict: Accepted):
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)

Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, T = map(int, input().split())
min = 100000
for i in range(N):
    min_temp, T_temp = map(int, input().split())
    if min_temp < min and T_temp <= T:
        min = min_temp

print(min)


Failing test case input:
4 3
1 1000
2 4
3 1010
4 500

Expected output:
TLE


Actual output:
100000


Fixed submission (verdict: Accepted):
N, T = map(int, input().split())
min = 100000
flg = False
for i in range(N):
    min_temp, T_temp = map(int, input().split())
    if min_temp < min and T_temp <= T:
        min = min_temp
        flg = True
print(min if flg == True else "TLE")

Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,T = map(int,input().split())
CT = []
for n in range(N):
  c,t = map(int,input().split())
  CT.append([c,t])
CT = sorted(CT,key=lambda x: x[0])
ans = False
for ct in CT:
  if ct[1] <= T:
    print(ct[0])
    ans = True
    break
if ans:
  print("TLE") 


Failing test case input:
-5 0
0 0100
1 1
4 1101
6 28

Expected output:
TLE


Actual output:

Fixed submission (verdict: Accepted):
N,T = map(int,input().split())
CT = []
for n in range(N):
  c,t = map(int,input().split())
  CT.append([c,t])
CT = sorted(CT,key=lambda x: x[0])
ans = True
for ct in CT:
  if ct[1] <= T:
    print(ct[0])
    ans = False
    break
if ans:
  print("TLE")

Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,t = map(int,input().split())
ct_list = []
less = []

for _ in range(n):
    a,b = map(int,input().split())
    if b < t:
        less.append(a)

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

Failing test case input:
5 9
25 8
5 9
4 10
0000 1000
6 1

Expected output:
5


Actual output:
6


Fixed submission (verdict: Accepted):
n,t = map(int,input().split())
ct_list = []
less = []

for _ in range(n):
    a,b = map(int,input().split())
    if b <= t:
        less.append(a)

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

Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, t_max = map(int, input().split())
ans = 1000

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

Failing test case input:
-1 0
0 0001
1 0
2 0001
1 14

Expected output:
TLE


Actual output:
1000


Fixed submission (verdict: Accepted):
n, t_max = map(int, input().split())
ans = 'TLE'

for i in range(n):
  c, t = map(int, input().split())
  if t <= t_max:
    ans = c if ans == 'TLE' else min(c, ans)
print(ans)
Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,T=map(int,input().split())
l=[]
for i in range(n):
    l.append(list(map(int,input().split())))
c=[]
t=[]
for i in range(n):
    c.append(l[i][0])
    t.append(l[i][1])

c_n=[]
t_n=[]
for i in range(n):
    if t[i]<=T:
        c_n.append(c[i])
        t_n.append(t[i])

if len(c_n)==0:
    print("TLE")
else:
    for i in range(len(c_n)):
        if t_n[i]==max(t_n):
            print(c_n[i])
            break




Failing test case input:
3 36
7 94
1 2
7 20

Expected output:
1


Actual output:
7


Fixed submission (verdict: Accepted):
n,T=map(int,input().split())
l=[]
for i in range(n):
    l.append(list(map(int,input().split())))
c=[]
t=[]
for i in range(n):
    c.append(l[i][0])
    t.append(l[i][1])

c_n=[]
t_n=[]
for i in range(n):
    if t[i]<=T:
        c_n.append(c[i])
        t_n.append(t[i])

if len(c_n)==0:
    print("TLE")
else:
    for i in range(len(c_n)):
        if c_n[i]==min(c_n):
            print(c_n[i])
            break

Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, T = map(int, input().split())

mc = float("inf")
ans = "TLE"

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

print(ans)

Failing test case input:
5 9
25 8
5 9
4 10
0100 1000
6 1

Expected output:
5


Actual output:
6


Fixed submission (verdict: Accepted):
N, T = map(int, input().split())

mc = float("inf")
ans = "TLE"

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

print(ans)

Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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],reverse=True)
for i in l:
    if i[1]<t:
        print(i[0])
        break
print('TLE')


Failing test case input:
3 91
7 94
2 80
7 50

Expected output:
2


Actual output:
7
TLE


Fixed submission (verdict: Accepted):
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()
print('TLE')

Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,T=map(int,input().split())
ans=float('inf')
for i in range(N):
  c,t=map(int,input().split())
  if t<=T and c<ans :
    ans=c
if ans>10000000000:
  ans='TLE'
else:
  print(ans)
  

Failing test case input:
-2 -4
0 0001
1 0
2 0001
2 14

Expected output:
TLE


Actual output:

Fixed submission (verdict: Accepted):
N,T=map(int,input().split())
ans=10000000000
for i in range(N):
  c,t=map(int,input().split())
  if t<=T and c<ans :
    ans=c
if ans==10000000000:
  ans='TLE'
  print(ans)
else:
  print(ans)
Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, T = map(int, input().split())
ct = [list(map(int, input().split())) for _ in range(N)]
ret = 10 ** 9
for c, t in ct:
	if t <= T:
		ret = min(ret, c)
print(ret)

Failing test case input:
-5 -8
0 0100
1 1
4 0100
6 45

Expected output:
TLE


Actual output:
1000000000


Fixed submission (verdict: Accepted):
N, T = map(int, input().split())
ct = [list(map(int, input().split())) for _ in range(N)]
ret = 10 ** 9
for c, t in ct:
	if t <= T:
		ret = min(ret, c)
if ret < 10 ** 9:
	print(ret)
else:
	print("TLE")

Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b = map(int, input().split())
e = []
for i in range(a):
    c, d = map(int, input().split())
    if b>=d:
        e.append(c)
print(min(e) if not e == [] else "ELT")

Failing test case input:
-5 -8
0 0100
1 1
4 0100
6 45

Expected output:
TLE


Actual output:
ELT


Fixed submission (verdict: Accepted):
a, b = map(int, input().split())
e = []
for i in range(a):
    c, d = map(int, input().split())
    if b>=d:
        e.append(c)
print(min(e) if not e == [] else "TLE")

Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, T = map(int, input().split())
c, t = list(map(int, input().split()))
ans = 1001
i = 0
for i in range(N):
    if T > t and c < ans:
        ans = c

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

Failing test case input:
3 36
7 94
2 2
7 20

Expected output:
2


Actual output:
1001


Fixed submission (verdict: Accepted):
N, T = map(int, input().split())
i = 0
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)

Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,t=map(int,input().split())
tici=[]
for i in range(n):
	ci,ti=map(int,input().split())
	if(ti<=t):
		tici.append([ti,ci])
if(len(tici)==0):
	print('TLE')
else:
	tici.sort()
	print(tici[0][1])

Failing test case input:
5 9
25 8
5 9
4 10
0000 1000
6 1

Expected output:
5


Actual output:
6


Fixed submission (verdict: Accepted):
n,t=map(int,input().split())
tici=[]
for i in range(n):
	ci,ti=map(int,input().split())
	if(ti<=t):
		tici.append([ci,ti])
if(len(tici)==0):
	print('TLE')
else:
	tici.sort()
	print(tici[0][0])

Problem: p03239
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n, t = map(int, input().split())
res = t + 1
for i in range(n):
    ci, ti = map(int, input().split())
    if ti <= t:
        res = min(res, ci)

if res == t + 1:
    print("TLE")
else:
    print(res)

Failing test case input:
4 0
0 0100
-1 6
1 1010
6 -1

Expected output:
6


Actual output:
TLE


Fixed submission (verdict: Accepted):
n, t = map(int, input().split())
res = 1000 + 1
for i in range(n):
    ci, ti = map(int, input().split())
    if ti <= t:
        res = min(res, ci)

if res == 1001:
    print("TLE")
else:
    print(res)
Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)
  

Failing test case input:
-2 -1
0 0101
1 0
2 0001
3 12

Expected output:
TLE


Actual output:
1000


Fixed submission (verdict: Accepted):
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)

Problem: p03239
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
ma = lambda :map(int,input().split())
lma = lambda :list(map(int,input().split()))
tma = lambda :tuple(map(int,input().split()))
ni = lambda:int(input())
yn = lambda fl:print("Yes") if fl else print("No")
import collections
import math
import itertools
import heapq as hq
import sys
n,T = ma()
ans=10**15
for i in range(n):
    c,t=ma()
    if t<T:
        ans=min(ans,c)
if ans==10**15:
    print("TLE")
else:print(ans)


Failing test case input:
2 1
0 0110
0 1
-1 0011
0 -2

Expected output:
0


Actual output:
TLE


Fixed submission (verdict: Accepted):
ma = lambda :map(int,input().split())
lma = lambda :list(map(int,input().split()))
tma = lambda :tuple(map(int,input().split()))
ni = lambda:int(input())
yn = lambda fl:print("Yes") if fl else print("No")
import collections
import math
import itertools
import heapq as hq
import sys
n,T = ma()
ans=10**15
for i in range(n):
    c,t=ma()
    if t<=T:
        ans=min(ans,c)
if ans==10**15:
    print("TLE")
else:print(ans)

Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, T = map(int, input().split())
ans = 1000

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


Failing test case input:
-2 -2
0 0001
1 0
2 0001
2 14

Expected output:
TLE


Actual output:
1000


Fixed submission (verdict: Accepted):
N, T = map(int, input().split())
ans = 1001

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

Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, T = map(int, input().split())
cost = 1001
for i in range(N):
	c, t = map(int, input().split())
	if t < T:
		if c < cost:
			cost = c
			
print(cost)

Failing test case input:
-4 -2
0 0100
1 0
1 0001
3 31

Expected output:
TLE


Actual output:
1001


Fixed submission (verdict: Accepted):
N, T = map(int, input().split())
cost = 1001
for i in range(N):
	c, t = map(int, input().split())
	if t <= T:
		if c < cost:
			cost = c

if cost == 1001:
	print("TLE")
else:
	print(cost)
Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,T=map(int,input().split())
C=1000
for i in range(n):
    c,t=map(int,input().split())
    if t<=T:
        C=min(C,c)
print(C)


Failing test case input:
-2 -2
0 0100
0 0
2 0011
4 12

Expected output:
TLE


Actual output:
1000


Fixed submission (verdict: Accepted):
n,T=map(int,input().split())
C=1001
for i in range(n):
    c,t=map(int,input().split())
    if t<=T:
        C=min(C,c)
if C==1001:
    print("TLE")
    exit()
print(C)

Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,T = map(int,input().split())
ans = [c[-1] for c,t in sorted([(input().split()) for i in range(N)],key=lambda x :x[1]) if int(t)<=T]
if len(ans)!=0:
    print(ans)
else:
    print("TLE")

Failing test case input:
5 9
3 8
5 9
4 10
0100 1000
6 0

Expected output:
3


Actual output:
6, 3, 5

Fixed submission (verdict: Accepted):
N,T = map(int,input().split())
ans = [int(c) for c,t in [(input().split()) for i in range(N)] if int(t)<=T]
if len(ans)!=0:
    print(min(ans))
else:
    print("TLE")

Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N , T  = map(int,input().split())
tmp_a = 1000
result = 0
count = 1
while count < N+1:
 a,b = map(int,input().split())
 if b <= T and a < tmp_a:
  result = count
  tmp_a = a
 count = count + 1
if result == 0:
 print('TLE')
else:
 print(result)

Failing test case input:
3 70
7 94
1 80
4 50

Expected output:
4


Actual output:
3


Fixed submission (verdict: Accepted):
N , T  = map(int,input().split())
result = 1001
while N > 0:
 a,b = map(int,input().split())
 if b <= T and a < result:
  result = a
 N = N - 1
if result == 1001:
 print('TLE')
else:
 print(result)

Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,T = input().split(" ")
N,T = int(N),int(T)

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

Failing test case input:
-2 -4
0 0101
1 -1
2 0001
3 14

Expected output:
TLE


Actual output:

Fixed submission (verdict: Accepted):
N,T = input().split(" ")
N,T = int(N),int(T)

time = dict()
for i in range(N):
	c,t = input().split(" ")
	time[int(c)] = int(t)
cost = 10000

for key, value in sorted(time.items(), key=lambda item: item[1]):
	if value <= T:
		if cost > key:
			cost = key
			

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

Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, T = map(int, input().split())
ct = [list(map(int, input().split())) for _ in range(n)]

ans = []
for i in ct:
    if i[1] <= T:
        ans.append(i)
if len(ans) == 0:
    print('TEL')
else:
    print(min(ans, key=lambda x: x[0])[0])

Failing test case input:
-1 0
0 0101
1 0
2 0001
2 14

Expected output:
TLE


Actual output:
TEL


Fixed submission (verdict: Accepted):
n, T = map(int, input().split())
ct = [list(map(int, input().split())) for _ in range(n)]

ans = []
for i in ct:
    if i[1] <= T:
        ans.append(i[0])
if len(ans) == 0:
    print('TLE')
else:
    print(min(ans))
Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, T = [int(s) for s in input().split()]

c = []
t = []
for n in range(N):
    inputs = input().split()
    c.append(int(inputs[0]))
    t.append(int(inputs[1]))

min_cost = None
for i in range(N):
    if t[i] <= T and (min_cost is None or c[i] <= min_cost):
        min_cost = c[i]
        result = i

if min_cost is None:
    print("TLE")
else:
    print(i+1)


Failing test case input:
4 -1
-1 0101
-1 6
1 1010
-1 -2

Expected output:
-1


Actual output:
4


Fixed submission (verdict: Accepted):
N, T = [int(s) for s in input().split()]

c = []
t = []
for n in range(N):
    inputs = input().split()
    c.append(int(inputs[0]))
    t.append(int(inputs[1]))

min_cost = "TLE"
for i in range(N):
    if t[i] <= T and (min_cost is "TLE" or c[i] <= min_cost):
        min_cost = c[i]

print(min_cost)

Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, T = map(int, input().split())
ans = 1001
for i in range(N):
    c, t = map(int, input().split())
    if t < T:
        ans = min(ans, c)
print(ans)


Failing test case input:
-2 -2
0 0100
0 0
2 0001
4 17

Expected output:
TLE


Actual output:
1001


Fixed submission (verdict: Accepted):
N, T = map(int, input().split())
ans = 1001
for _ in range(N):
    c, t = map(int, input().split())
    if t <= T:
        ans = min(ans, c)
print(ans if ans <= 1000 else "TLE")

Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,t = map(int,input().split())
m = 9999
for i in range(n):
  c,y = map(int,input().split())
  if y<t:
    m=min(m,c)
print("TLE" if m==9999 else m)

Failing test case input:
2 1
0 0110
0 1
-1 0011
0 -2

Expected output:
0


Actual output:
TLE


Fixed submission (verdict: Accepted):
n,t = map(int,input().split())
m = 9999
for i in range(n):
  c,y = map(int,input().split())
  if y<=t:
    m=min(m,c)
print("TLE" if m==9999 else m)

Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,T = list(map(int,input().split()))
C = [list(map(int,input().split())) for i in range(N)]
C = sorted(C, key = lambda x : x[1],reverse =False)

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

print(min(A) if min(A) != 0 else "TLE")

Failing test case input:
3 70
7 94
2 80
4 50

Expected output:
4


Actual output:
TLE


Fixed submission (verdict: Accepted):
N,T = list(map(int,input().split()))
C = [list(map(int,input().split())) for i in range(N)]
C = sorted(C, key = lambda x : x[1],reverse =False)


A =[1001]
for i in C:
    if i[1] <= T:
        A.append(i[0])

print(min(A) if min(A) != 1001 else "TLE")
Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, T = map(int, input().split())

mini = 10**9
flg = False
for i in range(n):
    c, t = map(int, input().split())
    if T > t:
        flg = True
        if mini > t:
            ans = c
if flg: print(c)
else: print('TLE')

Failing test case input:
3 36
7 94
2 2
7 20

Expected output:
2


Actual output:
7


Fixed submission (verdict: Accepted):
n, T = map(int, input().split())

ans = 10**9
flg = False
for i in range(n):
    c, t = map(int, input().split())
    if T >= t:
        flg = True
        ans = min(ans, c)
if flg: print(ans)
else: print('TLE')

Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,T=map(int,input().split())
data=[input().split() for i in range(n)]
lc=[]
for row in data:
    if int(row[1]) <=T:
        lc.append(row[0])

if not lc:
    print("TLE")
else:
    a=sorted(lc)
    print(a[0])

Failing test case input:
5 9
25 8
5 9
4 10
0000 1000
6 1

Expected output:
5


Actual output:
25


Fixed submission (verdict: Accepted):
n,T=map(int,input().split())
data=[input().split() for i in range(n)]
lc=[]
for row in data:
    if int(row[1]) <=T:
        lc.append(row[0])
ls=[int(j) for j in lc]

if not lc:
    print("TLE")
else:
    print(min(ls))

Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

n, t0 = map(int, input().split())
ans = 10000000000
for _ in range(n):
    c, t = map(int, input().split())
    if(t<=t0 and c<=ans):
        ans = c
if(ans==10000000000):
    print("TLE")
else:
    print(c)

Failing test case input:
5 9
25 8
5 9
4 10
1000 1000
6 1

Expected output:
5

Actual output:
6


Fixed submission (verdict: Accepted):

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

if(ans==10000000000):
    print("TLE")
else:
    print(ans)
Problem: p03239
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
from __future__ import print_function


import sys
import math
import string
import fractions
import re
import array
import copy
import functools
import operator

import collections
import itertools
import bisect
import heapq


from heapq import heappush
from heapq import heappop



import random




def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)


def main():
    n,t = map(int, input().split())
    minx=sys.maxsize
    for i in range(n):
        cc,tt = map(int, input().split())
        if tt<=t:
            minx = cc if cc<minx else minx
    print(minx)
    
if __name__ == '__main__':
    main()


Failing test case input:
-5 -8
0 0100
1 1
2 0100
3 31

Expected output:
TLE


Actual output:
9223372036854775807


Fixed submission (verdict: Accepted):
from __future__ import print_function


import sys
import math
import string
import fractions
import re
import array
import copy
import functools
import operator

import collections
import itertools
import bisect
import heapq


from heapq import heappush
from heapq import heappop



import random




def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)


def main():
    n,t = map(int, input().split())
    minx=sys.maxsize
    for i in range(n):
        cc,tt = map(int, input().split())
        if tt<=t:
            minx = cc if cc<minx else minx
    if minx<sys.maxsize:
        print(minx)
    else:
        print("TLE")



if __name__ == '__main__':
    main()

Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B = map(int,input().split())
q = 0
for i in range(A):
  S = list(map(int,input().split()))
  if i == 0 and S[1] <= B:
    p = S[0]
    q = p
  elif S[1] <= B and S[0] < q:
    q=S[0]
  else:
    pass
if q != 0:
  print(q)
else:
  print('TLE')

Failing test case input:
4 0
0 0100
-1 6
1 1010
6 -1

Expected output:
6


Actual output:
TLE


Fixed submission (verdict: Accepted):
A,B = map(int,input().split())
q = 100000
for i in range(A):
  S = list(map(int,input().split()))
  if S[1] <= B and S[0] < q:
    q=S[0]
  else:
    pass
if q < 10000:
  print(q)
else:
  print('TLE')

Problem: p03239
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N,T = map(int,input().split())
mn = 10**10
for i in range(N):
    c,t = map(int,input().split())
    print(c,t)
    if t <= T and c <= mn:
        mn = c
if mn == 10**10:
    print("TLE")
else:
    print(mn)



Failing test case input:
3 70
7 94
0 80
9 50

Expected output:
9


Actual output:
7 94
0 80
9 50
9


Fixed submission (verdict: Accepted):
N,T = map(int,input().split())
mn = 10**10
for i in range(N):
    c,t = map(int,input().split())
    
    if t <= T and c <= mn:
        mn = c
if mn == 10**10:
    print("TLE")
else:
    print(mn)
Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,T=list(map(int,input().split()))
c=[]
t=[]
for i in range(N):
    a,b=list(map(int,input().split()))
    c.append(a)
    t.append(b)
tmp=1001
for i in range(N):
    if(t[i]<=T):
        if(tmp>c[i]):
            tmp=c[i]
if(tmp==1001):    print("TLE")
else:    print(c[i])

Failing test case input:
5 9
25 8
5 9
4 10
1000 1000
6 1

Expected output:
5

Actual output:
6


Fixed submission (verdict: Accepted):
N,T=list(map(int,input().split()))
c=[]
t=[]
for i in range(N):
    a,b=list(map(int,input().split()))
    c.append(a)
    t.append(b)
tmp=1001
for i in range(N):
    if(t[i]<=T):
        if(tmp>c[i]):
            tmp=c[i]
if(tmp==1001):    print("TLE")
else:    print(tmp)

Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,t = map(int,input().split())

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

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

Failing test case input:
-2 -4
0 0001
2 0
2 0001
2 14

Expected output:
TLE


Actual output:
LTE


Fixed submission (verdict: Accepted):
n,t = map(int,input().split())

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

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

Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, T = map(int,input().split())
c = []
t = []

for i in range(N):
  a, b = map(int,input().split())
  c.append(a)
  t.append(b)
  
min_cost = 10**5
for i in range(N):
  if t[i]<=T and min_cost>c[i]:
    min_cost=c[i]

if min_cost==10**3:
  print("TLE")
else:
  print(min_cost)

Failing test case input:
-2 -4
0 0101
1 0
2 0001
2 14

Expected output:
TLE


Actual output:
100000


Fixed submission (verdict: Accepted):
N, T = map(int,input().split())
c = []
t = []

for i in range(N):
  a, b = map(int,input().split())
  c.append(a)
  t.append(b)
  
min_cost = 10**4
for i in range(N):
  if t[i]<=T and min_cost>c[i]:
    min_cost=c[i]

if min_cost==10**4:
  print("TLE")
else:
  print(int(min_cost))

Problem: p03239
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n,lim = map(int,input().split())

ans = 10000

for i in range(n):
    cost,time = map(int,input().split())
    
    if time <= lim and cost < ans:
        ans = cost

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

Failing test case input:
-2 -2
0 0100
2 0
2 0001
3 12

Expected output:
TLE


Actual output:
10000


Fixed submission (verdict: Accepted):
n,lim = map(int,input().split())

ans = 10000

for i in range(n):
    cost,time = map(int,input().split())
    
    if time <= lim and cost < ans:
        ans = cost

if ans == 10000:
    print("TLE")
else:
    print(ans)
Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n_list = list(map(int, input().split()))


n = n_list[0]
time = n_list[1]

x = 0
output = 'TLE'
num = 1

while num <= n:
    n_list2 = list(map(int, input().split()))
    if time - n_list2[1] > 0:
        if x - (time - n_list2[1]) < 0:
            output = n_list2[1]
            num += 1
        else:
          num += 1
    else:
      num += 1

print(output)


Failing test case input:
2 3
0 1100
2 1
2 0011
4 156

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
n_list = list(map(int, input().split()))


n = n_list[0]
TIME = n_list[1]

x = 0
num = 1
costs = []

while num <= n:
    cost, time = list(map(int, input().split()))
    num += 1
    if TIME - time >= 0:
        costs.append(cost)

if len(costs) != 0:
    output = min(costs)
else:
    output = "TLE"
print(output)

Problem: p03239
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n,T = map(int,input().split())
c = [0]*n
t = [0]*n

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

cost= 10000
for i in range(n):
    if t[i] <= T and c[i] <= cost:
        cost = c[i]
        print(i)
if cost == 10000:
    print("TLE")
else:
    print(cost)

Failing test case input:
3 36
7 94
2 2
7 20

Expected output:
2


Actual output:
1
2


Fixed submission (verdict: Accepted):
n,T = map(int,input().split())
c = [0]*n
t = [0]*n

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

cost= 10000
for i in range(n):
    if t[i] <= T and c[i] <= cost:
        cost = c[i]
        
if cost == 10000:
    print("TLE")
else:
    print(cost)

Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, t = map(int, input().split())
ans = float('inf')
for _ in range(n):
    x, y = map(int, input().split())
    if y <= t:
        ans = min(ans, x)
print(ans)

Failing test case input:
1 -1
0 0101
1 0
2 0001
1 14

Expected output:
TLE


Actual output:
inf


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

Problem: p03239
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, T = map(int, input().split())
ct = [list(map(int, input().split())) for _ in range(n)]

ans = []
for i in ct:
    if i[1] <= T:
        ans.append(i[0])
if len(ans) == 0:
    print('TEL')
else:
    print(min(ans))

Failing test case input:
-2 -4
0 0001
1 0
2 0001
2 14

Expected output:
TLE


Actual output:
TEL


Fixed submission (verdict: Accepted):
n, T = map(int, input().split())
ct = [list(map(int, input().split())) for _ in range(n)]

ans = []
for i in ct:
    if i[1] <= T:
        ans.append(i[0])
if len(ans) == 0:
    print('TLE')
else:
    print(min(ans))