ZhenlongDai/ACPR huggingface dataset:
Problem: p03030
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())

sList = []
for i in range(n):
  sList.append(list(input().split())+[i+1])
  sList[i][1] = -1*int(sList[i][1])
sList.sort()

print(sList)
for i in sList:
  print(i[2])


Failing test case input:
6
khkrbbsvoa 12
dvqnor -1
k_zn` 20
zao`k 92
wmdosl -1
kbaqnvtail 1

Expected output:
2
3
6
1
5
4


Actual output:
[['dvqnor', 1, 2], ['k_zn`', -20, 3], ['kbaqnvtail', -1, 6], ['khkrbbsvoa', -12, 1], ['wmdosl', 1, 5], ['zao`k', -92, 4]]
2
3
6
1
5
4


Fixed submission (verdict: Accepted):
n = int(input())

sList = []
for i in range(n):
  sList.append(list(input().split())+[i+1])
  sList[i][1] = -1*int(sList[i][1])
sList.sort()

for i in sList:
  print(i[2])

Problem: p03030
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
sp=[[0]*3 for i in range(N)]
for i in range(N):
    sp[i][0], sp[i][1] = input().split()
    sp[i][1] = int(sp[i][1])
    sp[i][2] = i

sp = sorted(sp, key=lambda x:x[0])
sp = sorted(sp, key=lambda x:x[1])
for i in sp:
    print (i[2])


Failing test case input:
10
lrstkay 17
lutsayj 2
zatujsk 125
yt`llus -1
isvykat 23
skskvax 5
ksuukby 32
xvstlbm 100
yavjtsk 317
irsakuy 111

Expected output:
10
5
7
1
2
6
8
9
4
3


Actual output:
3
1
5
0
4
6
7
9
2
8


Fixed submission (verdict: Accepted):
N = int(input())
sp=[[0]*3 for i in range(N)]
for i in range(N):
    sp[i][0], sp[i][1] = input().split()
    sp[i][1] = int(sp[i][1])
    sp[i][2] = i+1

sp = sorted(sp, key=lambda x:x[1], reverse=True)
sp = sorted(sp, key=lambda x:x[0])
for i in sp:
    print (i[2])

Problem: p03030
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
l = []
for i in range(N):
    s, p = input().split(' ')
    l.append([s, int(p), i])
l.sort(key=lambda x:(x[0], -x[1]))
_ = [print(a[2]) for a in l]

Failing test case input:
10
yrssakl 0
t`xsujl -2
zatujtj 54
st`kluy -1
iyvlsat 30
skskvax -1
ycktusk 88
uvctlxl 100
jstjvay 112
kuyasri 111

Expected output:
5
9
10
6
4
2
8
7
1
3


Actual output:
4
8
9
5
3
1
7
6
0
2


Fixed submission (verdict: Accepted):
N = int(input())
l = []
for i in range(N):
    s, p = input().split(' ')
    l.append([s, int(p), i+1])
l.sort(key=lambda x:(x[0], -x[1]))
_ = [print(a[2]) for a in l]

Problem: p03030
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
X = []
for i in range(N):
	s, p = input().split()
	X.append([s, -int(p),  i+1])
X.sort()
for i in range(N):
	print(-X[i][1])

Failing test case input:
6
khkrbbsvoa 12
dxqoor -2
`_znk 20
kaoaz 18
omdwsl -2
kbaqnvtajl 0

Expected output:
3
2
4
6
1
5


Actual output:
20
-2
18
0
12
-2


Fixed submission (verdict: Accepted):
N = int(input())
X = []
for i in range(N):
	s, p = input().split()
	X.append([s, -int(p),  i+1])
X.sort()
for i in range(N):
	print(X[i][2])
Problem: p03030
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
l = []
for i in range(1,n+1):
    l += [list(map(str, input().split())) + [str(i)]]
l = sorted(sorted(l, key=lambda x:x[1], reverse=True), key=lambda x:x[0])
for i in range(len(l)):
    print(l[i][2])

Failing test case input:
10
yakutsk 10
yakutsk 20
yakutsk 30
yakutsk 40
yakutsk 50
yakutsk 60
yakutsk 70
yakktsu 80
yakutsk 90
yakutsk 100

Expected output:
8
10
9
7
6
5
4
3
2
1


Actual output:
8
9
7
6
5
4
3
2
10
1


Fixed submission (verdict: Accepted):
n = int(input())
l = []
for i in range(1,n+1):
    a, b = input().split()
    l += [[a,int(b),i]]
l = sorted(sorted(l, key=lambda x:x[1], reverse=True), key=lambda x:x[0])
for i in range(len(l)):
    print(l[i][2])

Problem: p03030
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
L = [[]*4]*N
S = ''
P = ''
for i in range(N):
  S, P = input().split()
  L[i] = [0, S, int(P)*-1, i, 0]
L.sort()
for i in range(N):
  L[i][0] = L[i][3]
  L[i][4] = i+1

L.sort()
for i in range(N):
  print(L[i][4])

Failing test case input:
10
yakuusk 18
kyastul 53
yskutak 76
y`kutsk -1
yakvtsk 5
yavktsk 60
yajutsk 70
yakksut 18
kstukay 160
yakutsk 110

Expected output:
9
2
4
7
8
10
1
5
6
3


Actual output:
7
2
10
3
8
9
4
5
1
6


Fixed submission (verdict: Accepted):
N = int(input())
L = [[]*3]*N
S = ''
P = ''
for i in range(N):
  S, P = input().split()
  L[i] = [S, int(P)*-1, i+1]

L.sort()

for i in range(N):
  print(L[i][2])

Problem: p03030
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def Guide():
    N = int(input())
    lst = []
    for i in range(1, N + 1):
        city, score = input().split()
        lst.append([city, int(score), i])
    sorted_lst = sorted(lst, key=lambda x:(x[0], x[1]))

    for l in sorted_lst:
        print(l[2])


Guide()


Failing test case input:
10
yakutsk 10
yakutsk 20
yakutsk 30
yakutsk 40
yakutsk 50
yakutsk 60
yakutsk 70
yakutsk 80
yakutsk 90
yakutsk 100

Expected output:
10
9
8
7
6
5
4
3
2
1

Actual output:
1
2
3
4
5
6
7
8
9
10


Fixed submission (verdict: Accepted):
def Guide():
    N = int(input())
    lst = []
    for i in range(1, N + 1):
        city, score = input().split()
        lst.append([city, int(score), i])
    sorted_lst = sorted(lst, key=lambda x:(x[0], -x[1]))

    for l in sorted_lst:
        print(l[2])


Guide()
Problem: p03030
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
stack = [['zzzzzzzzzz', -1]]
for i in range(n):
    s, p = input().split()
    p = int(p)
    stack.append([s, p])
cnt = set()
for i in range(len(stack)-1):
    x = 0
    for j in range(len(stack)):
        if j in cnt:
            continue
        else:
            if stack[x][0] >= stack[j][0] and stack[x][1] < stack[j][1]:
                x = j
    cnt.add(x)
    print(x)


Failing test case input:
6
kharbbsvok 12
dvpnor -1
k_zn` 20
k`oaz 55
wmdosl 0
kbaqnvtail 1

Expected output:
2
3
4
6
1
5


Actual output:
3
4
1
6
5
0


Fixed submission (verdict: Accepted):
n = int(input())
stack = [['zzzzzzzzzzz', -1]]
for i in range(n):
    s, p = input().split()
    p = int(p)
    stack.append([s, p])
cnt = {0}
for i in range(len(stack)-1):
    x = 0
    for j in range(1,len(stack)):
        if j in cnt:
            continue
        else:
            if stack[x][0] > stack[j][0]:
                x = j
            elif stack[x][0] == stack[j][0] and stack[x][1] < stack[j][1]:
                x = j
    cnt.add(x)
    print(x)

Problem: p03030
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
res = []
for i in range(n):
    s, p = input().split()
    p = int(p)
    res.append([i+1, s, p])

res = sorted(res, key=lambda x: (x[2], x[1]), reverse=True)
for r in res:
    print(r[0])

Failing test case input:
10
yrssakl 0
t`xsujl -2
zatujtj 54
st`kluy -1
iyvlsat 30
skskvax -1
ycktusk 88
uvctlxl 100
jstjvay 112
kuyasri 111

Expected output:
5
9
10
6
4
2
8
7
1
3


Actual output:
9
10
8
7
3
5
1
4
6
2


Fixed submission (verdict: Accepted):
n = int(input())
res = []
for i in range(n):
    s, p = input().split()
    p = int(p)
    res.append([i+1, s, p])

res = sorted(res, key=lambda x:x[2], reverse=True)
res = sorted(res, key=lambda x:x[1], reverse=False)
for r in res:
    print(r[0])
Problem: p02724
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math


num = int(input("num: "))


c_500 = math.floor(num / 500)
num2 = num - c_500 * 500

c_5 = math.floor(num2/5)



print(c_500 * 1000 +c_5 * 5)

Failing test case input:
1832

Expected output:
3330


Actual output:
num: 3330


Fixed submission (verdict: Accepted):
import math


num = int(input())


c_500 = math.floor(num / 500)
num2 = num - c_500 * 500

c_5 = math.floor(num2/5)



print(c_500 * 1000 +c_5 * 5)

Problem: p02724
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
inp = int(input())
add = int(inp / 500) * 1000
add += int((inp % 100) / 5) * 5
print(add)

Failing test case input:
1385

Expected output:
2385


Actual output:
2085


Fixed submission (verdict: Accepted):
import math
inp = int(input())
add = math.floor(inp / 500) * 1000
add += math.floor((inp % 500) / 5) * 5
print(add)

Problem: p02724
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = int(input())
b = a % 500
c = a - b
d = int(c / 500)
e = b % 5
x = d * 1000 + e * 5
print(x)

Failing test case input:
1885

Expected output:
3385


Actual output:
3000


Fixed submission (verdict: Accepted):
a = int(input())
b = a % 500
c = a - b
d = int(c / 500) * 1000
e = b % 5
f = b - e
print(d + f)

Problem: p02724
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N=int(input())
n1=N
n2=N-n1*500
n3=n2
print(n1*1000+n3*5)

Failing test case input:
1000000000

Expected output:
2000000000

Actual output:
-1495000000000


Fixed submission (verdict: Accepted):
N=int(input())
n1=(N-N%500)/500
n2=N-n1*500
n3=(n2-n2%5)/5
print(int(n1*1000+n3*5))

Problem: p02724
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math;
x = int(input())

q, mod = divmod(x, 500)
mmod = math.floor(mod/5)
print(q, mod, mmod)

ans = 1000*q + 5*mmod
print(ans)

Failing test case input:
4459

Expected output:
8455


Actual output:
8 459 91
8455


Fixed submission (verdict: Accepted):
import math;
x = int(input())

q, mod = divmod(x, 500)
mmod = math.floor(mod/5)
ans = 1000*q + 5*mmod
print(ans)

Problem: p02724
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x = int(input())

ans = x 
print(ans)

Failing test case input:
1608

Expected output:
3105


Actual output:
1608


Fixed submission (verdict: Accepted):
x = int(input())

ans = 1000 * (x 
print(ans)

Problem: p02724
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math

N = int(input())


A = math.floor(N / 500)

N = N - A * 500

B = math.floor(N / 5)
print(B)

AA = A * 1000
BB = B * 5
print(AA + BB)

Failing test case input:
-160

Expected output:
-660


Actual output:
68
-660


Fixed submission (verdict: Accepted):
import math

N = int(input())


A = math.floor(N / 500)

N = N - A * 500

B = math.floor(N / 5)


AA = A * 1000
BB = B * 5
print(AA + BB)
Problem: p02724
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = int(input())
b = a % 500
c = a - b
d = int(c / 500)
e = b % 5
if e == 0:
    e = int(b / 5)
x = d * 1000 + e * 5
print(x)

Failing test case input:
1352

Expected output:
2350


Actual output:
2010


Fixed submission (verdict: Accepted):
a = int(input())
b = a % 500
c = a - b
d = int(c / 500) * 1000
e = b % 5
f = b - e
print(d + f)

Problem: p02724
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from sys import stdin


def get_result(data):
    N = data[0]
    q, mod = divmod(N, 500)
    _, mod = divmod(mod, 5)
    return q * 1000 + mod * 5


if __name__ == '__main__':
    data = list(map(int, stdin.readline().rstrip('\n').split(' ')))
    result = get_result(data)
    print(result)

Failing test case input:
4459

Expected output:
8455


Actual output:
8020


Fixed submission (verdict: Accepted):
from sys import stdin


def get_result(data):
    N = data[0]
    q, mod = divmod(N, 500)
    q_5, _ = divmod(mod, 5)
    return q * 1000 + q_5 * 5


if __name__ == '__main__':
    data = list(map(int, stdin.readline().rstrip('\n').split(' ')))
    result = get_result(data)
    print(result)

Problem: p02724
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
x = int(input())

c500, r500 = map(int, divmod(x, 500))
c5 = int(x % 5)

ans1 = c500 * 1000 + c5 * 5

print(c500 * 1000 + c5 * 5)


Failing test case input:
2114

Expected output:
4110


Actual output:
4020


Fixed submission (verdict: Accepted):
x = int(input())

c500, r500 = map(int, divmod(x, 500))
c5 = int(r500 / 5)

ans1 = c500 * 1000 + c5 * 5

print(ans1)

Problem: p02724
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x = int(input())
t = x
print(t * 1000 + ((x - 500 * t) % 5) * 5)

Failing test case input:
-237

Expected output:
-740


Actual output:
-236985


Fixed submission (verdict: Accepted):
x = int(input())
t = x
print(t * 1000 + ((x - 500 * t)

Problem: p02724
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
X = int(input())

ans = 0

ans = X 
X = X % 500

ans = X 

print(ans)

Failing test case input:
2611

Expected output:
5110


Actual output:
111


Fixed submission (verdict: Accepted):
X = int(input())

ans = 0

ans = (X 
X = X % 500

ans += (X 

print(ans)

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



X = int(input())
x500 = X 
x5 = (X - x500) 
print((x500 + x5)*2)

Failing test case input:
722

Expected output:
1220


Actual output:
1444


Fixed submission (verdict: Accepted):



X = int(input())
x500 = X 
x5 = (X - X 
print(x500 + x5)

Problem: p02724
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
X=int(input())
ans=(X-X%500)*2
X=X-X%500
ans=ans+(X-X%5)
print(ans)

Failing test case input:
1254

Expected output:
2250


Actual output:
3000


Fixed submission (verdict: Accepted):
X=int(input())
ans=(X-X%500)*2
X=X%500
ans=ans+(X-X%5)
print(ans)
Problem: p02724
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
def main():
    
    arg = getInput(1024)
    ans = process(arg)
    print(ans)
    
def process(arg):
    yen500 = math.floor(arg / 500)
    amari = arg % 500
    yen5 = math.floor(amari / 5)
    ans = 1000 * yen500
    ans = ans + yen5 * 5

    return ans

def getInput(input):
    
    n = 1
    
    ret = None

    if n == 1:
        pass
        
        
        ret = int(input)
        
        
        
    else:
        for x in range(n):
            
            ret = input[x]

    return ret

if __name__ == '__main__':
    main()


Failing test case input:
1100000000

Expected output:
2200000000


Actual output:
2020


Fixed submission (verdict: Accepted):
import math
def main():
    arg = getInput(input())
    
    ans = process(arg)
    print(ans)
    
def process(arg):
    yen500 = math.floor(arg / 500)
    amari = arg % 500
    yen5 = math.floor(amari / 5)
    ans = 1000 * yen500
    ans = ans + yen5 * 5

    return ans

def getInput(input):
    
    n = 1
    
    ret = None

    if n == 1:
        pass
        
        
        ret = int(input)
        
        
        
    else:
        for x in range(n):
            
            ret = input[x]

    return ret

if __name__ == '__main__':
    main()

Problem: p02724
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())

cnt=0

if n>=500:
  cnt+=n
  n=n%500
  
cnt+=n

print(cnt)

Failing test case input:
1608

Expected output:
3105


Actual output:
1716


Fixed submission (verdict: Accepted):
n=int(input())
cnt=0

if n>=500:
  x=n
  n=n%500
  cnt+=(1000*x)
cnt+=(5*(n

print(cnt)

Problem: p02724
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
x = int(input())
a = x 
b = x % 500
b /= 5
print(int(a * 1000 + b * 5))

Failing test case input:
2949

Expected output:
5445


Actual output:
2949449


Fixed submission (verdict: Accepted):
x = int(input())
a = int(x 
b = int((x % 500) / 5)

print(int(a * 1000 + b * 5))

Problem: p02724
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
X = int(input())

A, B = divmod(X, 500)
C, D = divmod(X, 5)

print((A * 1000) + (C * 5))


Failing test case input:
1885

Expected output:
3385


Actual output:
4885


Fixed submission (verdict: Accepted):
X = int(input())
 
A, X = divmod(X, 500)
C, X = divmod(X, 5)
 
print((A * 1000) + (C * 5))

Problem: p02724
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x = int(input())
res = 1000 * x 
x = x % 500;
x -= x % 5
res += x
print(res)

Failing test case input:
2636

Expected output:
5135


Actual output:
2636135


Fixed submission (verdict: Accepted):
x = int(input())
res = 1000 * (x 
x = x % 500;
x -= x % 5
res += x
print(res)

Problem: p02724
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
x=int(input())
cnt=1000*(x%500)
x
cnt+=5*(x%5)
print(cnt)

Failing test case input:
-160

Expected output:
-660


Actual output:
340000


Fixed submission (verdict: Accepted):
x=int(input())
cnt=1000*(x
x=x%500
cnt+=5*(x
print(cnt)
Problem: p02724
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x = int(input())

q1, mod1 = divmod(x, 500)
q2, mod2 = divmod(mod1, 5)

print(mod1*1000 + mod2*5)

Failing test case input:
4459

Expected output:
8455


Actual output:
459020


Fixed submission (verdict: Accepted):
x = int(input())

q1, mod1 = divmod(x, 500)
q2, mod2 = divmod(mod1, 5)

print(q1*1000 + q2*5)

Problem: p02724
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
x = int(input())

c500, x = divmod(x, 500)
c5 = x % 5

print(c500 * 1000 + c5 * 5)

Failing test case input:
1352

Expected output:
2350


Actual output:
2010


Fixed submission (verdict: Accepted):
x = int(input())

c500, r500 = map(int, divmod(x, 500))
c5 = int(r500 / 5)

ans1 = c500 * 1000 + c5 * 5

print(ans1)

Problem: p02724
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
X = int(input())
a = X%500
print(a*1000 + 5*((X-a*500)%5))

Failing test case input:
1352

Expected output:
2350


Actual output:
352010


Fixed submission (verdict: Accepted):
X = int(input())
a = X
print(a*1000 + 5*((X%500)

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

X = int(input())
ans = 1000*(X%500)
X 
ans += 5*(X%5)
print(ans)

Failing test case input:
4459

Expected output:
8455


Actual output:
459020


Fixed submission (verdict: Accepted):

X = int(input())
ans = 1000*(X
X %= 500
ans += 5*(X
print(ans)

Problem: p02724
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = n
b = a
print(1000*a+b)

Failing test case input:
1285

Expected output:
2285


Actual output:
1286285


Fixed submission (verdict: Accepted):
n = int(input())
a = n
b = n-500*a
print(a*1000+b

Problem: p02724
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
x = int(input())

if x%500 == 0:
  print(x*2)
else:
  ans = x
  print(ans)


Failing test case input:
1885

Expected output:
3385


Actual output:
1885


Fixed submission (verdict: Accepted):
x = int(input())
 
if x%500 == 0:
  print(x*2)
else:
  X = (x
  ans = (X*1000) + ((x%500)
  print(ans)

Problem: p02724
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
x=int(input())
i=0
j=0
if 500<= x:
  while i*500<x:
    i+=1
  i-=1
  x-=500*i
if 5<=x:
  while j*5<x:
    j+=1
  j-=1
if i==0 and j==0:
  print(0)
else:
  print(1000*i+5*j)


Failing test case input:
1885

Expected output:
3385


Actual output:
3380


Fixed submission (verdict: Accepted):
x=int(input())
a=x
i=0
j=0
if 500<= x:
  while i*500<x:
    i+=1
  i-=1
  x-=500*i
if 5<=x:
  while j*5<x:
    j+=1
  j-=1
if i==0 and j==0:
  print(0)
elif a%500==0:
  print(a
else:
  print(1000*i+5*j)

Problem: p02724
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
x = int(input())

c500, r500 = map(int, divmod(x, 500))
c5 = int(r500 % 5)

ans1 = c500 * 1000 + c5 * 5

print(c500 * 1000 + c5 * 5)

Failing test case input:
948

Expected output:
1445


Actual output:
1015


Fixed submission (verdict: Accepted):
x = int(input())

c500, r500 = map(int, divmod(x, 500))
c5 = int(r500 / 5)

ans1 = c500 * 1000 + c5 * 5

print(ans1)
Problem: p02724
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
inp = int(input())
add = int(inp / 500) * 1000
add += ((inp % 100) % 5) * 5
print(add)

Failing test case input:
1254

Expected output:
2250


Actual output:
2020


Fixed submission (verdict: Accepted):
import math
inp = int(input())
add = math.floor(inp / 500) * 1000
add += math.floor((inp % 500) / 5) * 5
print(add)

Problem: p02724
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
X = int(input())
q, mod = divmod(X, 500)
print(q*1000+mod % 5*5)


Failing test case input:
1000000001

Expected output:
2000000000


Actual output:
2000000005


Fixed submission (verdict: Accepted):
X = int(input())
q, mod = divmod(X, 500)
print(q*1000+mod

Problem: p02724
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
X = int(input())
print((X%500)%5)

Failing test case input:
2611

Expected output:
5110


Actual output:
1


Fixed submission (verdict: Accepted):
X = int(input())
print(X

Problem: p02724
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
X = int(input())
 
A, B = divmod(X, 500)
C, D = divmod(X, 5)
 
print(A * 1000 + C * 5)

Failing test case input:
1311

Expected output:
2310


Actual output:
3310


Fixed submission (verdict: Accepted):
X = int(input())
 
A, X = divmod(X, 500)
C, X = divmod(X, 5)
 
print((A * 1000) + (C * 5))

Problem: p02724
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
pl = 0

q, mod = divmod(10, 500)
pl += q * 1000

q, mod = divmod(10, 5)
pl += q * 5

print(pl)


Failing test case input:
1000000001

Expected output:
2000000000


Actual output:
10


Fixed submission (verdict: Accepted):
n = int(input())
pl = 0
 
q, mod = divmod(n, 500)
pl += q * 1000

q, mod = divmod(mod, 5)
pl += q * 5

print(pl)

Problem: p02724
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
x = int(input())

a = math.ceil(x/500)
a_1000 = a*1000

amari = x % 500
b_5 = amari*5

print(a_1000 + b_5)


Failing test case input:
1254

Expected output:
2250


Actual output:
4270


Fixed submission (verdict: Accepted):
import math
x = int(input())

a = math.floor(x/500)
a_1000 = a*1000

amari = x % 500
b = math.floor(amari/5)
b_5 = b*5

print(a_1000 + b_5)
Problem: p02724
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys, re
import math
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7



x = INT()
a = math.floor(x / 500)
b = math.floor((x - (a * 500)) / 5)
print(a)
print(b)
print(a * 1000 + b * 5)

Failing test case input:
1385

Expected output:
2385


Actual output:
2
77
2385


Fixed submission (verdict: Accepted):
import sys, re
import math
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7



x = INT()
if x == 0:
    print(0)
else:
    a = math.floor(x / 500)
    b = math.floor((x - (a * 500)) / 5)
    print(a * 1000 + b * 5)

Problem: p02724
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())

div_500, mod_500 = divmod(n,500)
if mod_500 > 0:
    div_5, mod = divmod(mod_500, 5)
    print(div_500*1000 + div_5*5)
else:
    print(div_500*100)

Failing test case input:
1100000000

Expected output:
2200000000


Actual output:
220000000


Fixed submission (verdict: Accepted):
n = int(input())

div_500, mod_500 = divmod(n,500)
if mod_500 > 0:
    div_5, mod = divmod(mod_500, 5)
    print(div_500*1000 + div_5*5)
else:
    print(div_500*1000)

Problem: p02724
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=int(input())
hp = (a-(a%500))/500
f=(a%500)
ct=int(hp)*1000
ct+=int((f-(a%5))/5)*5

Failing test case input:
2611

Expected output:
5110


Actual output:

Fixed submission (verdict: Accepted):
a=int(input())
hp = (a-(a%500))/500
f=(a%500)
ct=int(hp)*1000
ct+=int((f-(a%5))/5)*5
print(ct)

Problem: p02724
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = int(input())
count1=-1
count2=-1
while s>=0:
 s=s-500
 count1=count1 +1
s=s+500
print(count1)
if s==0:
  yasashisa=count1*1000
  print(yasashisa)
else:
   while s >=0:
     s=s-5
     count2=count2 +1
   yasashisa=count1*1000+count2* 5
   print(yasashisa)





Failing test case input:
1254

Expected output:
2250


Actual output:
2
2250


Fixed submission (verdict: Accepted):
s = int(input())
count1=-1
count2=-1
while s>=0:
 s=s-500
 count1=count1 +1
s=s+500
if s==0:
  yasashisa=count1*1000
  print(yasashisa)
else:
   while s >=0:
     s=s-5
     count2=count2 +1
   yasashisa=count1*1000+count2* 5
   print(yasashisa)

Problem: p02724
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
X=int(input())
ans=0
if X>=500:
  ans+=X
  X=X-ans*500
if X>=5:
  ans+=X
print(ans)

Failing test case input:
2611

Expected output:
5110


Actual output:
2611


Fixed submission (verdict: Accepted):
X=int(input())
ans=0
if X>=500:
  ans+=(X
  X=X-(ans
if X>=5:
  ans+=(X
print(ans)
Problem: p02724
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
x = int(input())

a = math.floor(x/500)
a_1000 = a*1000
print(a)

amari = x % 500
b = math.floor(amari/5)
b_5 = b*5
print(amari)

print(a_1000 + b_5)

Failing test case input:
1608

Expected output:
3105


Actual output:
3
108
3105


Fixed submission (verdict: Accepted):
import math
x = int(input())

a = math.floor(x/500)
a_1000 = a*1000

amari = x % 500
b = math.floor(amari/5)
b_5 = b*5

print(a_1000 + b_5)
Problem: p03457
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
In = [map(int, input().split()) for _ in range(N)]

s = (0, 0)
t = 0
success = True

for move in In:
    before_x, before_y = s
    tn, after_x, after_y = move

    dist_xy = abs(after_x - before_x) + abs(after_y - before_y)
    walk = tn - t

    if walk < dist_xy:
        success *= False

    if walk % 2 == 0 and dist_xy % 2 != 0:
        success *= False
    elif walk % 2 != 0 and dist_xy % 2 == 0:
        success *= False

    s = (after_x, after_y)
    t = tn

print("YES" if success else "NO")

Failing test case input:
2
5 2 1
111 1 0

Expected output:
Yes


Actual output:
YES


Fixed submission (verdict: Accepted):
N = int(input())
In = [map(int, input().split()) for _ in range(N)]

s = (0, 0)
t = 0
success = True

for move in In:
    before_x, before_y = s
    tn, after_x, after_y = move

    dist_xy = abs(after_x - before_x) + abs(after_y - before_y)
    walk = tn - t

    if walk < dist_xy:
        success *= False

    if walk % 2 == 0 and dist_xy % 2 != 0:
        success *= False
    elif walk % 2 != 0 and dist_xy % 2 == 0:
        success *= False

    s = (after_x, after_y)
    t = tn

print("Yes" if success else "No")

Problem: p03457
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
if n==1:
  exit()
t0=x0=y0=0
f=0
for i in range(n):
  t,x,y=map(int,input().split())
  t1=t-t0
  x1=abs(x-x0)
  y1=abs(y-y0)
  if t1<x1+y1 or t1%2!=(x1+y1)%2:
    f=1
  t0=t
  x0=x
  y0=y
if f==1:
  print('No')
else:
  print('Yes')

Failing test case input:
1
3 111 001

Expected output:
No


Actual output:

Fixed submission (verdict: Accepted):
n=int(input())
t0=x0=y0=0
f=0
for i in range(n):
  t,x,y=map(int,input().split())
  t1=t-t0
  x1=abs(x-x0)
  y1=abs(y-y0)
  if t1<x1+y1 or t1%2!=(x1+y1)%2:
    f=1
  t0=t
  x0=x
  y0=y
if f==1:
  print('No')
else:
  print('Yes')

Problem: p03457
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N = int(input())
T = [0]
coo = [(0, 0)]
for i in range(N):
    t, x, y = map(int, input().split())
    T.append(t)
    coo.append((x, y))

for i in range(N):
    dxdy = coo[i+1][0] - coo[i][0] + coo[i+1][1] - coo[i][1]
    if dxdy <= T[i+1] - T[i]:
        pass
    else:
        print('No')
        exit()
print('Yes')

Failing test case input:
2
3 2 1
011 1 1

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
N = int(input())
T = [0]
coo = [(0, 0)]
for i in range(N):
    t, x, y = map(int, input().split())
    T.append(t)
    coo.append((x, y))

for i in range(N):
    dxdy = coo[i+1][0] - coo[i][0] + coo[i+1][1] - coo[i][1]
    rt = (T[i+1] - T[i]) % 2
    rdxdy = dxdy % 2
    if dxdy <= T[i+1] - T[i] and rt == rdxdy:
        pass
    else:
        print('No')
        exit()
print('Yes')
Problem: p03457
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
p = [list(map(int, input().split())) for _ in range(n)]
ans = 'Yes'
t_diff = 0
x_diff = 0
y_diff = 0
for i in p:
  t_diff = i[0] - t_diff
  x_diff = abs(i[1] - x_diff)
  y_diff = abs(i[2] - y_diff)
  if t_diff > x_diff + y_diff:
    if (t_diff - x_diff - y_diff)%2 != 0:
      ans = 'No'
      break
  else:
    ans = 'No'
    break
print(ans)

Failing test case input:
2
2 1 1
101 2 1

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
n = int(input())
p = [list(map(int, input().split())) for _ in range(n)]
ans = 'Yes'
t_diff = 0
x_diff = 0
y_diff = 0
for i in p:
  t_diff = i[0] - t_diff
  x_diff = abs(i[1] - x_diff)
  y_diff = abs(i[2] - y_diff)
  if t_diff >= x_diff + y_diff:
    if (t_diff - x_diff - y_diff)%2 != 0:
      ans = 'No'
      break
  else:
    ans = 'No'
    break
print(ans)

Problem: p03457
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n=int(input())
l=[[] for i in range(n+1)]
l[0]=[0,0,0]
for i in range(1,n+1):
    l[i]=list(map(int,input().split()))
for i in range(n):
    flag=False
    t=l[i+1][0]-l[i][0]
    x=l[i+1][1]-l[i][1]
    y=l[i+1][2]-l[i][2]
    for a in range(t):
        for b in range(t-a):
            c=a-x
            d=b-y
            if a+b+c+d==t:
                flag=True
                break
        if flag: break
    if not flag:
        print("No")
        break
if flag: print("Yes")

Failing test case input:
2
2 1 1
101 2 1

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
n=int(input())
l=[[] for i in range(n+1)]
l[0]=[0,0,0]
for i in range(1,n+1):
    l[i]=list(map(int,input().split()))
for i in range(n):
    flag=False
    t=l[i+1][0]-l[i][0]
    x=l[i+1][1]-l[i][1]
    y=l[i+1][2]-l[i][2]
    for a in range(t+1):
        for b in range(t+1-a):
            c=a-x
            d=b-y
            if a+b+c+d==t:
                flag=True
                break
        if flag: break
    if not flag:
        print("No")
        break
if flag: print("Yes")

Problem: p03457
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
t1,x1,y1=[0,0,0]
for i in range(N-1):
  t2,x2,y2=[int(s) for s in input().split()]
  if t2-t1<abs(x2-x1)+abs(y2-y1) or (t2-t1)%2!=(x2+y2-x1-y1)%2:
    print("No")
    break
  else:
    t1,x1,y1==[t2,x2,y2]
else:
  print("Yes")

Failing test case input:
1
8 111 110

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
N=int(input())
t1,x1,y1=[0,0,0]
for i in range(N):
  t2,x2,y2=[int(s) for s in input().split()]
  if t2-t1<abs(x2-x1)+abs(y2-y1) or (t2-t1)%2!=(x2+y2-x1-y1)%2:
    print("No")
    break
  else:
    t1,x1,y1==[t2,x2,y2]
else:
  print("Yes")
Problem: p03457
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

bt, bx, by = 0, 0, 0
flg = True
for i in range(N):
    t, x, y = map(int, input().split())
    dist = abs(x-bx)+abs(y-by)
    time = t-bt
    if time>=dist and (time-dist)%2==0:
        bt, bx, xy = t, x, y
    else:
        flg = False
        break

if flg:
    print('Yes')
else:
    print('No')

Failing test case input:
2
2 1 1
101 2 1

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
N = int(input())

bt, bx, by = 0, 0, 0

for _ in range(N):
    t, x, y = map(int, input().split())
    dist = abs(x-bx)+abs(y-by)
    time = t-bt
    if time<dist or time%2!=dist%2:
        print('No')
        break
    bt, bx, by = t, x, y
else:
    print('Yes')

Problem: p03457
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
for i in range(n):
    t,x,y=map(int,input().split())
    if x+y>t or (x+y+t)%2==1:
      print("NO")
      exit()
print("YES")


Failing test case input:
2
5 1 1
111 1 0

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
import sys
N=int(input())
for i in range(N):
  t,x,y=map(int,input().split())
  if (x+y)%2==t%2 and x+y<=t:
    pass
  else:
    print('No')
    sys.exit()
print('Yes')

Problem: p03457
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
t=0
x=0
y=0
ans ="Yes"
for i in range(n):
  tt,xx,yy = map(int,input().split())
  dif = abs(x-xx)
  dif +=abs(y-yy)
  if dif>(tt-t) :
    ans = "No"
    break;
  t=tt
  x=xx
  y=yy
print(ans)

Failing test case input:
2
5 2 1
100 1 0

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
n = int(input())
t=0
x=0
y=0
ans ="Yes"
for i in range(n):
  tt,xx,yy = map(int,input().split())
  dif = abs(x-xx)
  dif +=abs(y-yy)
  if dif>(tt-t) or dif%2 !=(tt-t)%2:
    ans = "No"
    break;
  t=tt
  x=xx
  y=yy
print(ans)

Problem: p03457
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
t=0
x=0
y=0
for i in range(N):
    t_next,x_next,y_next=map(int,input().split())
    zikan=t_next - t
    kyori=abs(x_next-x)+abs(y_next-y)
    if kyori>zikan or (zikan-kyori)%2==1:
        print('NO')
        exit(0)
    t,x,y=t_next,x_next,y_next
print('YES')

Failing test case input:
2
5 1 1
100 1 0

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
N=int(input())
t=0
x=0
y=0
for i in range(N):
    t_next,x_next,y_next=map(int,input().split())
    zikan=t_next - t
    kyori=abs(x_next-x)+abs(y_next-y)
    if kyori>zikan or (zikan-kyori)%2==1:
        print('No')
        exit(0)
    t,x,y=t_next,x_next,y_next
print('Yes')
Problem: p03457
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
k = 0
for i in range(n):
    t,x,y = map(int,input().split())
    if t < x + y or t % 2 == (x + y) %2:
        print('No')
        break
    if i == n-1:
        print('Yes')

Failing test case input:
2
7 1 1
100 1 0

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
n = int(input())
k = 0
for i in range(n):
    t,x,y = map(int,input().split())
    if t < x + y or t % 2 != (x + y) %2:
        print('No')
        break
    if i == n-1:
        print('Yes')

Problem: p03457
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

for i in range(N):
    t,x,y = map(int, input().split())
    if x + y < t or (x + y + t) % 2:
        print("No")
        exit()
print("Yes")

Failing test case input:
1
3 001 100

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
N = int(input())
for _ in range(N):
    t, x, y = map(int, input().split())
    if x + y > t or (t + x + y)%2 != 0:
        print("No")
        quit()
print("Yes")

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
















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

pos = [0,0]
time = 0
for row in rows:
    t,x,y = row
    tt = t - time
    xx = abs(x-pos[0])
    yy = abs(y-pos[1])
    num = tt-(xx+yy)
    if num>=0 and num%2==0:
        pos = [x,y]
        time = 3
    else:
        print("No")
        exit()

print("Yes")







Failing test case input:
2
2 1 1
100 1 0

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
















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

pos = [0,0]
time = 0
for row in rows:
    t,x,y = row
    tt = t - time
    xx = abs(x-pos[0])
    yy = abs(y-pos[1])
    num = tt-(xx+yy)
    if num>=0 and num%2==0:
        pos = [x,y]
        time = t
    else:
        print("No")
        exit()

print("Yes")

Problem: p03457
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
point = [0, 0]
t_list = []
ans = "Yes"
t = list(map(int, input().split()))
dis = abs(point[0]-t[1])+abs(point[1]-t[2])
t_list.append(t)
if t[0] < dis:
    ans = "No"
point = [t[1], t[2]]
for i in range(N-1):
    t = list(map(int, input().split()))
    dis = abs(point[0]-t[1])+abs(point[1]-t[2])
    if t_list[-1][0]-t[0] < dis:
        ans = "No"
    point = [t[1], t[2]]
    t_list.append(t)
print(ans)

Failing test case input:
1
4 001 000

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
N = int(input())
point = [0, 0]
t_list = []
ans = "Yes"
t = list(map(int, input().split()))
dis = abs(point[0]-t[1])+abs(point[1]-t[2])
t_list.append(t)
if t[0] < dis or t[0]%2!=dis%2:
    ans = "No"
point = [t[1], t[2]]
for i in range(N-1):
    t = list(map(int, input().split()))
    dis = abs(point[0]-t[1])+abs(point[1]-t[2])
    if t[0]-t_list[-1][0] < dis or (t[0]-t_list[-1][0])%2!=dis%2:
        ans = "No"
    point = [t[1], t[2]]
    t_list.append(t)
print(ans)
Problem: p03457
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
Sorted = [list(map(int, input().split())) for _ in range(N)]
Sorted.insert(0, [0, 0, 0])

for i in range(N):
  if abs(Sorted[i+1][1] - Sorted[i][1]) + abs(Sorted[i+1][2] - Sorted[i][2]) > Sorted[i+1][0] - Sorted[i][0]:
    print("No")
    break
  elif abs(Sorted[i+1][1] - Sorted[i][1]) == 0 and abs(Sorted[i+1][2] - Sorted[i][2]) == 0:
    print("No")
    break
else:
  print("Yes")

Failing test case input:
2
5 1 1
111 1 0

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
N = int(input())
Sorted = [list(map(int, input().split())) for _ in range(N)]
Sorted.insert(0, [0, 0, 0])

for i in range(N):
  d = abs(Sorted[i+1][1] - Sorted[i][1]) + abs(Sorted[i+1][2] - Sorted[i][2])
  t = Sorted[i+1][0] - Sorted[i][0]
  if  d > t or d % 2 != t % 2:
    print("No")
    break
else:
  print("Yes")

Problem: p03457
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

plan = []
for i in range(N):
    plan += [[int(n) for n in input().split(' ')]]

ret = "YES"
t0 , x0, y0 = 0, 0, 0
for t, x, y in  plan:
    dt = t-t0
    dx = abs(x-x0)
    dy = abs(y-y0)
    result = dt - (dx+dy)
    if (result<0) | (result%2!=0):
        ret = "NO"
        break
    t0, x0, y0 = t, x, y
print(ret)


Failing test case input:
1
3 110 001

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
N = int(input())

plan = []
for i in range(N):
    plan += [[int(n) for n in input().split(' ')]]

ret = "Yes"
t0 , x0, y0 = 0, 0, 0
for t, x, y in  plan:
    dt = t-t0
    dx = abs(x-x0)
    dy = abs(y-y0)
    result = dt - (dx+dy)
    if result<0:
        ret = "No"
        break
    if result%2!=0:
        ret = "No"
        break
    t0, x0, y0 = t, x, y
print(ret)

Problem: p03457
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
import sys

n = int(input())

X = 0
Y = 0
T = 0

for i in range(n):
	t,x,y = map(int, input().split())
	d = abs(X-x)+abs(Y-y)

	if d > t-T or (d - (t-T)) % 2 != 0:
				print('No')
	else:
		X = x
		Y = y
		T = t

print('Yes')


Failing test case input:
2
5 2 4
000 1 0

Expected output:
No


Actual output:
No
No
Yes


Fixed submission (verdict: Accepted):
import math
import sys

n = int(input())

for i in range(n):
	t,x,y = map(int, input().split())
	d = abs(x)+abs(y)

	if d > t or (d - t) % 2 != 0:
		print('No')
		exit()

print('Yes')

Problem: p03457
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
ans=[]
for i in range(N):
 t,x,y=map(int, input().split())
 if t<x+y:
  ans+='No'
 elif (t%2==0 and (x+y)%2==1):
  ans.append('No')
 elif (t%2==1 and (x+y)%2==0):
  ans.append('No')
 else:
  ans.append('Yes')
if 'No' in ans:
 print('No')
else:
 print('Yes')

Failing test case input:
1
2 100 100

Expected output:
No

Actual output:
Yes


Fixed submission (verdict: Accepted):
N=int(input())
ans=[]
for i in range(N):
 t,x,y=map(int, input().split())
 if t<x+y:
  ans.append('No')
 elif (t%2==0 and (x+y)%2==1):
  ans.append('No')
 elif (t%2==1 and (x+y)%2==0):
  ans.append('No')
 else:
  ans.append('Yes')
if 'No' in ans:
 print('No')
else:
 print('Yes')
Problem: p03457
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

bt, bx, by = 0, 0, 0
flg = True

for i in range(N):
    t, x, y = map(int, input().split())
    dist = abs(x-bx)+abs(y-by)
    time = t-bt
    if time<dist or time%2!=dist%2:
        flg = False
        print('No')
        break
    bt, bx, xy = t, x, y
else:
    print('Yes')
    

Failing test case input:
2
5 2 3
100 1 0

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
N = int(input())

bt, bx, by = 0, 0, 0

for _ in range(N):
    t, x, y = map(int, input().split())
    dist = abs(x-bx)+abs(y-by)
    time = t-bt
    if time<dist or time%2!=dist%2:
        print('No')
        break
    bt, bx, by = t, x, y
else:
    print('Yes')

Problem: p03457
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
t = [0 for _ in range(n+1)]
x = [0 for _ in range(n+1)]
y = [0 for _ in range(n+1)]
for i in range(n):
    t[i+1], x[i+1], y[i+1] = [int(z) for z in input().split()]
    dt = t[i+1] - t[i]
    dist = abs(x[i + 1] - x[i]) + abs(y[i + 1] - y[i])
    if not dt > dist and (t[i] % 2 != (abs(x[i]) + abs(y[i])) % 2):
        print('No')
        exit()
print('Yes')


Failing test case input:
1
1 000 110

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
n = int(input())
t = [0 for _ in range(n+1)]
x = [0 for _ in range(n+1)]
y = [0 for _ in range(n+1)]
for i in range(n):
    t[i+1], x[i+1], y[i+1] = [int(z) for z in input().split()]
    if t[i+1] - t[i] < abs(x[i + 1] - x[i]) + abs(y[i + 1] - y[i]) or (t[i+1] % 2 != (abs(x[i+1]) + abs(y[i+1])) % 2):
        print('No')
        exit()
print('Yes')

Problem: p03457
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
timeNum = int(input())

placeSequence = list()
for pivot in range(timeNum):
  placeSequence.append(list(map(int, input().split(' '))))

def compatibleCoordinate(time, x, y):
  if time % 2 == (abs(x) +  abs(y) % 2) and time >= abs(x) + abs(y):
    return True
  else:
    return False

time = x = y = 0

for place in placeSequence:
  objectTime, objectX, objectY = place
  flag = compatibleCoordinate(objectTime-time, objectX-x, objectY-y)
  if flag:
    time = objectTime
    x = objectX
    y = objectY
    continue
  else:
    print('No')
    break

else:
  print('Yes')

Failing test case input:
2
5 2 1
111 1 0

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
timeNum = int(input())

placeSequence = list()
for pivot in range(timeNum):
  placeSequence.append(list(map(int, input().split(' '))))

def compatibleCoordinate(time, x, y):
  if time % 2 == (abs(x) +  abs(y)) % 2 and time >= abs(x) + abs(y):
    return True
  else:
    return False

time = x = y = 0

for place in placeSequence:
  objectTime, objectX, objectY = place
  flag = compatibleCoordinate(objectTime-time, objectX-x, objectY-y)
  if flag:
    time = objectTime
    x = objectX
    y = objectY
    continue
  else:
    print('No')
    break

else:
  print('Yes')
Problem: p03457
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())

for i in range(n):
    t, x, y = map(int, input().split())
    if x+y > t or x+y+t % 2:
        print("NO")
        exit()
print("YES")


Failing test case input:
2
-2 4 8
101 4 2

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
n = int(input())

for i in range(n):
    t, x, y = map(int, input().split())
    if (x+y) > t or (x+y+t) % 2:
        print("No")
        exit()
print("Yes")

Problem: p03457
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
P = [list(map(int,input().split())) for i in range(N)]
flag = False
for tmp in P:
  t,x,y = tmp
  sum_ = x + y
  if (t % 2 == 0 and sum_ % 2 != 0) or (t % 2 != 0 and sum_ % 2 == 0):
    flag = True
    break
if flag:
  print('No')
else:
  print('Yes')

Failing test case input:
1
0 111 001

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
N = int(input())
P = [list(map(int,input().split())) for i in range(N)]
flag = False
for tmp in P:
  t,x,y = tmp
  sum_ = x + y
  if (t % 2 == 0 and sum_ % 2 != 0) or (t % 2 != 0 and sum_ % 2 == 0) or t < sum_:
    flag = True
    break
if flag:
  print('No')
else:
  print('Yes')

Problem: p03457
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
d = [list(map(int, input().split())) for i in range(n)]

t, x, y = 0, 0, 0

flag = True
for ti, xi, yi in d:
  if ti >= x + y:
    if (ti - t) % 2 != (abs(xi - x) + abs(yi - y)) % 2:
    	flag = False
    	break
    t = ti
    x = xi
    y = yi
    
  else:
    flag = False
    break
    
print("Yes" if flag else "No")

Failing test case input:
1
0 010 010

Expected output:
No


Actual output:
Yes


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

t, x, y = 0, 0, 0

flag = True
for ti, xi, yi in d:
  if ti >= xi + yi:
    if (ti - t) % 2 != (abs(xi - x) + abs(yi - y)) % 2:
    	flag = False
    	break
    t = ti
    x = xi
    y = yi
    
  else:
    flag = False
    break
    
print("Yes" if flag else "No")

Problem: p03457
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n=int(input())

a,b,c=0,0,0

for i in range(n):
  x,y,z=map(int,input().split())
  dist=abs(b-y)+abs(c-z)
  if dist>x-a or dist-(x-a)%2==1:
    print('No')
    exit()
    
  else:
    a,b,c=x,y,z
    continue
    
print('Yes')

Failing test case input:
2
6 2 1
011 1 1

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
n=int(input())

a,b,c=0,0,0

for i in range(n):
  x,y,z=map(int,input().split())
  dist=abs(b-y)+abs(c-z)
  if dist>x-a or (dist-(x-a))%2==1:
    print('No')
    exit()
    
  else:
    a,b,c=x,y,z
    continue
    
print('Yes')
Problem: p03457
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N = int(input())
PX = [list(map(int,input().split()))]

judge = True
pos = [0,0,0]
for p in PX:
    t = pos[0]
    x = pos[1]
    y = pos[2]
    ti = p[0]
    xi = p[1]
    yi = p[2]
    if abs(x-xi)+abs(y-yi) > (ti-t):
        judge = False
    if (x+y+(ti-t))%2 != (xi+yi)%2:
        judge = False
if judge:
    print("Yes")
else:
    print("No")

Failing test case input:
2
3 2 1
111 1 1

Expected output:
No


Actual output:
Yes


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

judge = True
pos = [0,0,0]
for p in PX:
    t = pos[0]
    x = pos[1]
    y = pos[2]
    ti = p[0]
    xi = p[1]
    yi = p[2]
    if abs(x-xi)+abs(y-yi) > (ti-t):
        judge = False
    if (x+y+(ti-t))%2 != (xi+yi)%2:
        judge = False
if judge:
    print("Yes")
else:
    print("No")

Problem: p03457
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N = int(input())
T = [0]
coo = [(0, 0)]
for i in range(N):
    t, x, y = map(int, input().split())
    T.append(t)
    coo.append((x, y))

for i in range(N):
    dxdy = coo[i+1][0] - coo[i][0] + coo[i+1][1] - coo[i][1]
    rt = T[i+1] - T[i] % 2
    rdxdy = dxdy % 2
    if dxdy <= T[i+1] - T[i] and rt == rdxdy:
        pass
    else:
        print('No')
        exit()
print('Yes')

Failing test case input:
2
2 1 1
100 1 1

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
N = int(input())
T = [0]
coo = [(0, 0)]
for i in range(N):
    t, x, y = map(int, input().split())
    T.append(t)
    coo.append((x, y))

for i in range(N):
    dxdy = coo[i+1][0] - coo[i][0] + coo[i+1][1] - coo[i][1]
    rt = (T[i+1] - T[i]) % 2
    rdxdy = dxdy % 2
    if dxdy <= T[i+1] - T[i] and rt == rdxdy:
        pass
    else:
        print('No')
        exit()
print('Yes')

Problem: p03457
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def solve():
    N = int(input())
    t_i, x_i, y_i = map(int, input().split())
    for i in range(N-1):
        t_j, x_j, y_j = map(int, input().split())
        dt = t_j - t_i
        dxy = x_i + x_j - y_i - y_j
        if (dt > (t_j - t_i)) | (dt < (t_i - t_j)):
            return "No"
        if ((t_i - t_j) % 2) != (dxy % 2):
            return "No"
    return "Yes"


if __name__ == "__main__":
    print(solve())


Failing test case input:
2
6 2 1
011 1 1

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
def solve():
    N = int(input())
    t_i, x_i, y_i = 0, 0, 0
    for i in range(N):
        t_j, x_j, y_j = map(int, input().split())
        dt = t_j - t_i
        dxy = x_j - x_i + y_j - y_i
        if (dxy < -dt) | (dxy > dt):
            return "No"
        if ((t_i - t_j) % 2) != (dxy % 2):
            return "No"
        t_i, x_i, y_i = t_j, x_j, y_j
    return "Yes"


if __name__ == "__main__":
    print(solve())