Problem:


Score : 300 points

Problem Statement

AtCoDeer the deer is going on a trip in a two-dimensional plane.
In his plan, he will depart from point (0, 0) at time 0, then for each i between 1 and N (inclusive), he will visit point (x_i,y_i) at time t_i.

If AtCoDeer is at point (x, y) at time t, he can be at one of the following points at time t+1: (x+1,y), (x-1,y), (x,y+1) and (x,y-1).
Note that he cannot stay at his place.
Determine whether he can carry out his plan.

Constraints

1 ≤ N ≤ 10^5

0 ≤ x_i ≤ 10^5

0 ≤ y_i ≤ 10^5

1 ≤ t_i ≤ 10^5

t_i < t_{i+1} (1 ≤ i ≤ N-1)

All input values are integers.

Input

Input is given from Standard Input in the following format:

N
t_1 x_1 y_1
t_2 x_2 y_2
:
t_N x_N y_N

Output

If AtCoDeer can carry out his plan, print Yes; if he cannot, print No.

Sample Input 1

2
3 1 2
6 1 1

Sample Output 1

Yes

For example, he can travel as follows: (0,0), (0,1), (1,1), (1,2), (1,1), (1,0), then (1,1).

Sample Input 2

1
2 100 100

Sample Output 2

No

It is impossible to be at (100,100) two seconds after being at (0,0).

Sample Input 3

2
5 1 1
100 1 1

Sample Output 3

No



Sample input:
2
3 1 2
6 1 1


Sample output:
Yes

Submission status: Wrong Answer

Solution code:
N = int(input())
dt, dx, dy = 0, 0, 0
avilable = True
for i in range(N):
    t, x, y = map(int, input().split())
    if abs(x-dx)+abs(y-dy) > t-dt or (abs(x-dx)+abs(y-dy)) % 2 != (t-dt) % 2:
        avilable = False
if avilable:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
N = int(input())
T = [0]
X = [0]
Y = [0]
for n in range(N):
  t,x,y = map(int,input().split())
  T.append(t)
  X.append(x)
  Y.append(y)

for n in range(N):
  D = X[n+1]+Y[n+1]-X[n]-Y[n]
  if T[n+1]-T[n] == D:
    pass
  elif T[n+1]-T[n]>D and (T[n+1]-T[n]-D)%2==0:
    pass
  else:
    print("No")
    exit()
    
print("Yes")

Submission status: Wrong Answer

Solution code:
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')

Submission status: Wrong Answer

Solution code:
N = int(input())
t, x, y = 0, 0, 0
for i in range(N):
    t_i, x_i, y_i = map(int, input().split())
    T = t_i-t
    D = (x_i-x) + (y_i-y)
    if T % 2 != D % 2 or D > T:
        print("No")
        exit()
    else:
        t = t_i
        x = x_i
        y = y_i
print("Yes")

Submission status: Wrong Answer

Solution code:
n  = int(input())
plan = [tuple(map(int, input().split())) for _ in range(n)]

now, now_x, now_y = 0, 0, 0

for t, x, y in plan:
    if abs(x - now_x) + abs(y - now_y) > t:
        print('No')
        exit()
    elif (abs(x - now_x) + abs(y - now_y) - t) % 2 == 1:
        print('No')
        exit()
print('Yes')

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

from typing import Tuple
from typing import List


Coordinate = Tuple[int, int, int]


def main():
    N = int(input())
    codList: List[Coordinate] = [(0, 0, 0)]
    for i in range(0, N):
        args = list(map(lambda x: int(x), input().split()))
        codList.append((args[0], args[1], args[2]))

    for i in range(1, N + 1):
        start = codList[i - 1]
        end = codList[i]
        dis = distance(start, end)
        duration = end[0] - start[1]

        if (duration - dis >= 0) and ((duration - dis) % 2 == 0):
            continue
        else:
            print("No")
            return

    print("Yes")


def distance(cod1: Coordinate, cod2: Coordinate):
    return abs(cod1[1] - cod2[1]) + abs(cod1[2] - cod2[2])


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())
x = [0] * (N+1)
y = [0] * (N+1)
t = [0] * (N+1)
for i in range(N):
    a,b,c = map(int, input().split())
    t[i+1] = a
    x[i+1] = b
    y[i+1] = c

a = 'Yes'
for i in range(N):
    if t[i+1] - t[i] < x[i+1]-x[i] + y[i+1] - y[i]:
      a = 'No'
      break
    if (t[i+1] - t[i]) % 2 != (x[i+1] - x[i] + y[i+1] - y[i]) % 2:
      a = 'No'
      break
print(a)

Submission status: Wrong Answer

Solution code:
N = int(input())
x = [0] * (N+1)
y = [0] * (N+1)
t = [0] * (N+1)
for i in range(N):
    a,b,c = map(int, input().split())
    t[i+1] = a
    x[i+1] = b
    y[i+1] = c

a = 'Yes'
for i in range(N):
    if t[i+1] - t[i] < x[i+1]-x[i] + y[i+1] - y[i]:
      a = 'No'
    if (t[i+1] - t[i]) % 2 != (x[i+1] - x[i] + y[i+1] - y[i]) % 2:
      a = 'No'
print(a)

Submission status: Wrong Answer

Solution code:
n = int(input())
t = [0]
x = [0]
y = [0]
for i in range(n):
  t_, x_, y_ = map(int, input().split())
  t.append(t_)
  x.append(x_)
  y.append(y_)

for j in range(n):
  dt = t[j+1] - t[j]
  dx = x[j+1] - x[j]
  dy = y[j+1] - y[j]
  if dx+dy>dt or dt%2!=(dx+dy)%2:
    print('No')
    exit()
    
print('Yes')

Submission status: Wrong Answer

Solution code:
n = int(input())

res = 0
for i in range(n):
  t, x, y = map(int, input().split())

  if x+y<=t-res and t%2==(x+y)%2:
    res = res+t-x-y
  else:
    print('No')
    exit()
    
print('Yes')

Submission status: Wrong Answer

Solution code:
n = int(input())

res = 0
for i in range(n):
  t, x, y = map(int, input().split())

  if x+y<=t-res and t%2==(x+y)%2:
    if t-(x+y)!=res:
      res += t-(x+y)
  else:
    print('No')
    exit()
    
print('Yes')

Submission status: Wrong Answer

Solution code:
n = int(input())

res = 0
for i in range(n):
  t, x, y = map(int, input().split())

  if x+y<=t-res and t%2==(x+y)%2:
    res += t-(x+y)
  else:
    print('No')
    exit()
    
print('Yes')

Submission status: Wrong Answer

Solution code:
n = int(input())
t_ = 0
xy_ = [0,0]
for _ in range(n):
    t, *xy = map(int, input().split())
    ta = t - t_
    xya = [abs(xy[0]-xy_[0]), abs(xy[1]-xy_[1])]
    if sum(xya) > ta or (ta - sum(xya))%2 != 0:
        print("No")
        break
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
ans = "Yes"
N = int(input())
t = []
x = []
y = []
for i in range(N):
  tmp = input().split(" ")
  t.append(int(tmp[0]))
  x.append(int(tmp[1]))
  y.append(int(tmp[2]))

for j in range(N-1):
  dt = t[j+1] - t[j]
  dx = abs(x[j+1] - x[j])
  dy = abs(y[j+1] - y[j])
  if dt >= dx + dy and dt % 2 == (dx + dy) % 2:
    continue
  else:
    ans = "No"
    break

print(ans)

Submission status: Wrong Answer

Solution code:
#-*- coding: utf-8 -*-
N=int(input())
import numpy as np
t=np.arange(N)
x=np.arange(N)
y=np.arange(N)
for n in range(N):
    t[n], x[n], y[n] = map(int, input().split())

d=abs(x)+abs(y)

if all(t%2==(x+y)%2) and all(t>=(x+y)) and all(d<=t):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
#-*- coding: utf-8 -*-
N=int(input())
import numpy as np
t=np.arange(N)
x=np.arange(N)
y=np.arange(N)
for n in range(N):
    t[n], x[n], y[n] = map(int, input().split())

if all(t%2==(x+y)%2) and all(t>=(x+y)):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
#-*- coding: utf-8 -*-
N=int(input())
import numpy as np
t=np.arange(N)
x=np.arange(N)
y=np.arange(N)
for n in range(N):
    t[n], x[n], y[n] = map(int, input().split())

kekka=[]
for i in range(N):
    kekka.append(t[i]>=x[i]+y[i] and t[i]%2==(x[i]+y[i])%2)
if all(kekka):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
#Atcorder Begginers Selection traveling
N = int(input())
First_Point=[0,0,0]
mistake_flg=0
for i in range(N):
    Next_Point=list(map(int, input().split()))
    Moving_Time = Next_Point[0]-First_Point[0]
    Moving_Distance = abs(Next_Point[1]-First_Point[1])+abs(Next_Point[2]-First_Point[2])
    if Moving_Distance > Moving_Time:
        print('No')
        mistake_flg=1
        break
        
    elif Moving_Distance == Moving_Time:
        First_point = Next_Point
    
    elif (Moving_Distance % 2) == (Moving_Time % 2):
        First_point = Next_Point
    
    else:
        print('No')
        mistake_flg=1
        break

if mistake_flg==0:
    print('Yes')

Submission status: Wrong Answer

Solution code:
N = int(input())
First_Point=[0,0,0]
mistake_flg=0
for i in range(N):
    Next_Point=list(map(int, input().split()))
    Moving_Time=Next_Point[0]-First_Point[0]
    Moving_Distance=abs(Next_Point[1]-First_Point[1])+abs(Next_Point[2]-First_Point[2])
    if Moving_Distance>Moving_Time:
        print('No')
        mistake_flg=1
        break
        
    elif Moving_Distance==Moving_Time:
        First_point=Next_Point
    elif (Moving_Distance % 2)==(Moving_Time % 2):
        First_point=Next_Point
    else:
        print('No')
        mistake_flg=1
        break

if mistake_flg==0:
    print('Yes')

Submission status: Wrong Answer

Solution code:
N = int(input())
t = []
x = []
y = []
for i in range(N):
  a,b,c = map(int, input().split())
  t.append(a)
  x.append(b)
  y.append(c)

def helper():
  curt = 0
  curx = 0
  cury = 0
  for i in range(N):
    dt = t[i] - curt
    curt = dt

    dx = abs(x[i] - curx)
    curx = x[i]

    dy = abs(y[i] - cury)
    cury = y[i]

    #if dt < (dx+dy) or dt%2 != (dx+dy)%2:
    if dt < (dx+dy) or abs(dx+dy-dt) % 2 == 1:
      return False
  return True

a = helper()  
print('Yes') if a else print('No')

Submission status: Wrong Answer

Solution code:
N = int(input())
t = []
x = []
y = []
for i in range(N):
  a,b,c = map(int, input().split())
  t.append(a)
  x.append(b)
  y.append(c)

def helper():
  curt = 0
  curx = 0
  cury = 0
  for i in range(N):
    dt = t[i] - curt
    curt = dt

    dx = abs(x[i] - curx)
    curx = x[i]

    dy = abs(y[i] - cury)
    cury = y[i]

    if dt < (dx+dy) or dt%2 != (dx+dy)%2:
      return False
  return True

a = helper()  
print('Yes') if a else print('No')

Submission status: Wrong Answer

Solution code:
for _ in range(int(input())):
  t, x, y = map(int, input().split())
  if (x + y + t) % 2 or (x + y) > t:
    print('No')
    exit(0)
print('Yes')

Submission status: Wrong Answer

Solution code:
N=int(input())
P=[(0,0,0)]*(N+1)

D=[0]*(N+1)

P[0]=(0,0,0)
D[0]=1
for i in range(1,N+1):
    t,x,y=map(int,input().split())
    d=t-P[i-1][0]
    x=abs(x-P[i-1][1])
    y=abs(y-P[i-1][2])
    if d < (x+y) or ((x+y)==0 and d%2!=0): 
        print('No')
        break
    if (d-(x+y))%2==0 or d%(x+y)==0:
        D[i]=1
    P[i]=(t,x,y)
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
#  ABC 086 C - Traveling
N = int(input())

t = [0] * (N+1)
x = [0] * (N+1)
y = [0] * (N+1)

for i in range(1,N+1):
    t[i],x[i],y[i] = map(int,input().split())

boolian = True    
        
for i in range(N):
    delta_t = t[i+1] - t[i]
    delta_x = x[i+1] - x[i]
    delta_y = y[i+1] - y[i]
    
    delta_x = abs(delta_x)
    delta_y = abs(delta_y)
    
    delta_sum = delta_x + delta_y
    
    k = delta_sum % 2 
    j = delta_t % 2

    if -delta_t <= delta_sum and delta_sum <= delta_t:
        if k == 0 and j == 0:
            boolian = True
        if k == 1 and j == 1:
            boolian = True
        else:
            boolian = False
            print('No')
            break
    else:
        boolian = False
        print('No')
        break

if boolian == True:
    print('Yes')

Submission status: Wrong Answer

Solution code:
#  ABC 086 C - Traveling
N = int(input())

t = [0] * (N+1)
x = [0] * (N+1)
y = [0] * (N+1)

for i in range(1,N+1):
    t[i],x[i],y[i] = map(int,input().split())

boolian = True    
        
for i in range(N):
    delta_t = t[i+1] - t[i]
    delta_x = x[i+1] - x[i]
    delta_y = y[i+1] - y[i]
    
    delta_sum = delta_x + delta_y
    
    delta_x = abs(delta_x)
    delta_y = abs(delta_y)
    
    k = delta_sum % 2 
    j = delta_t % 2

    if -delta_t <= delta_sum and delta_sum <= delta_t:
        if k == 0 and j == 0:
            boolian = True
        if k == 1 and j == 1:
            boolian = True
        else:
            boolian = False
            print('No')
            break
    else:
        boolian = False
        print('No')
        break

if boolian == True:
    print('Yes')

Submission status: Wrong Answer

Solution code:
#  ABC 086 C - Traveling
N = int(input())

t = [0] * (N+1)
x = [0] * (N+1)
y = [0] * (N+1)

for i in range(1,N+1):
    t[i],x[i],y[i] = map(int,input().split())

boolian = True    
        
for i in range(N):
    delta_t = t[i+1] - t[i]
    delta_x = x[i+1] - x[i]
    delta_y = y[i+1] - y[i]

    delta_x = abs(delta_x)
    delta_y = abs(delta_y)
    
    delta_sum = delta_x + delta_y
    k = delta_sum % 2 
    j = delta_t % 2

    if -delta_t <= delta_sum and delta_sum <= delta_t:
        if k == 0 and j == 0:
            boolian = True
        if k == 1 and j == 1:
            boolian = True
        else:
            boolian = False
            print('No')
            break
    else:
        boolian = False
        print('No')
        break

if boolian == True:
    print('Yes')

Submission status: Wrong Answer

Solution code:
#  ABC 086 C - Traveling
N = int(input())

t = [0] * (N+1)
x = [0] * (N+1)
y = [0] * (N+1)

for i in range(1,N+1):
    t[i],x[i],y[i] = map(int,input().split())

boolian = True    
        
for i in range(N):
    delta_t = t[i+1] - t[i]
    delta_x = x[i+1] - x[i]
    delta_y = y[i+1] - y[i]

    delta_sum = delta_x + delta_y
    k = delta_sum % 2 
    j = delta_t % 2

    if -delta_t <= delta_sum and delta_sum <= delta_t:
        if k == 0 and j == 0:
            boolian = True
        if k == 1 and j == 1:
            boolian = True
        else:
            boolian = False
            print('No')
            break
    else:
        boolian = False
        print('No')
        break

if boolian == True:
    print('Yes')

Submission status: Wrong Answer

Solution code:
N = int(input())

t = [0] * (N+1)
x = [0] * (N+1)
y = [0] * (N+1)

for i in range(1,N+1):
    t[i],x[i],y[i] = map(int,input().split())

boolian = True    
        
if N > 1:
    for i in range(N):
        delta_t = t[i+1] - t[i]
        delta_x = x[i+1] - x[i]
        delta_y = y[i+1] - y[i]

        delta_sum = delta_x + delta_y
        k = delta_sum % 2 
        j = delta_t % 2

        if -delta_t <= delta_sum and delta_sum <= delta_t:
            if k == 0 and j == 0:
                boolian = True
            if k == 1 and j == 1:
                boolian = True
            else:
                boolian = False
                print('No')
                break
        else:
            boolian = False
            print('No')
            break


if boolian == True:
    print('Yes')

Submission status: Wrong Answer

Solution code:
N = int(input())

t = [0] * (N+1)
x = [0] * (N+1)
y = [0] * (N+1)

for i in range(1,N+1):
    t[i],x[i],y[i] = map(int,input().split())

boolian = True    

if N == 1:
    delta_t = t[0]
    delta_x = x[0]
    delta_y = y[0]
    
    delta_sum = delta_x + delta_y
    k = delta_sum % 2 
    j = delta_t % 2
    
    if -delta_t < delta_sum and delta_sum < delta_t:
        if k == 0 and j == 0:
            boolian = True
        if k == 1 and j == 1:
            boolian = True
        else:
            boolian = False
            print('No')
    else:
        boolian = False
        print('No')
        
if N > 1:
    for i in range(N):
        delta_t = t[i+1] - t[i]
        delta_x = x[i+1] - x[i]
        delta_y = y[i+1] - y[i]

        delta_sum = delta_x + delta_y
        k = delta_sum % 2 
        j = delta_t % 2

        if -delta_t <= delta_sum and delta_sum <= delta_t:
            if k == 0 and j == 0:
                boolian = True
            if k == 1 and j == 1:
                boolian = True
            else:
                boolian = False
                print('No')
                break
        else:
            boolian = False
            print('No')
            break


if boolian == True:
    print('Yes')

Submission status: Wrong Answer

Solution code:
N = int(input())

t = [0] * (N+1)
x = [0] * (N+1)
y = [0] * (N+1)

for i in range(1,N+1):
    t[i],x[i],y[i] = map(int,input().split())

boolian = True    

if N == 1:
    delta_t = t[0]
    delta_x = x[0]
    delta_y = y[0]
    
    delta_sum = delta_x + delta_y
    k = delta_sum % 2 
    j = delta_t % 2
    
    if -delta_t < delta_sum and delta_sum < delta_t:
        if k == 0 and j == 0:
            boolian = True
        if k == 1 and j == 1:
            boolian = True
        else:
            boolian = False
            print('No')
    else:
        boolian = False
        print('No')
        
if N > 1:
    for i in range(N+1):
        delta_t = t[i+1] - t[i]
        delta_x = x[i+1] - x[i]
        delta_y = y[i+1] - y[i]

        delta_sum = delta_x + delta_y
        k = delta_sum % 2 
        j = delta_t % 2

        if -delta_t < delta_sum and delta_sum < delta_t:
            if k == 0 and j == 0:
                boolian = True
            if k == 1 and j == 1:
                boolian = True
            else:
                boolian = False
                print('No')
                break
        else:
            boolian = False
            print('No')
            break


if boolian == True:
    print('Yes')

Submission status: Wrong Answer

Solution code:
N = int(input())

t = [0] * N
x = [0] * N
y = [0] * N

for i in range(N):
    t[i],x[i],y[i] = map(int,input().split())

boolian = True    

if N == 1:
    delta_t = t[0]
    delta_x = x[0]
    delta_y = y[0]
    
    delta_sum = delta_x + delta_y
    k = delta_sum % 2 
    j = delta_t % 2
    
    if -delta_t < delta_sum and delta_sum < delta_t:
        if k == 0 and j == 0:
            boolian = True
        if k == 1 and j == 1:
            boolian = True
        else:
            boolian = False
            print('No')
    else:
        boolian = False
        print('No')
        
if N > 1:
    for i in range(N-1):

        delta_t = t[i+1] - t[i]
        delta_x = x[i+1] - x[i]
        delta_y = y[i+1] - y[i]

        delta_sum = delta_x + delta_y
        k = delta_sum % 2 
        j = delta_t % 2

        if -delta_t < delta_sum and delta_sum < delta_t:
            if k == 0 and j == 0:
                boolian = True
            if k == 1 and j == 1:
                boolian = True
            else:
                boolian = False
                print('No')
                break
        else:
            boolian = False
            print('No')
            break


if boolian == True:
    print('Yes')

Submission status: Wrong Answer

Solution code:
N = int(input())

t = [0] * N
x = [0] * N
y = [0] * N

for i in range(N):
    t[i],x[i],y[i] = map(int,input().split())

boolian = True    

if N == 1:
    delta_t = t[0]
    delta_x = x[0]
    delta_y = y[0]
    
    delta_sum = delta_x + delta_y
    k = delta_sum % 2 
    j = delta_t % 2
    
    if -delta_t < delta_sum and delta_sum < delta_t:
        if k == 0 and j == 0:
            boolian = True
        if k == 1 and j == 1:
            boolian = True
        else:
            boolian = False
            print('No')
    else:
        boolian = False
        print('No')
        
if N > 1:
    for i in range(N-1):

        delta_t = t[i+1] - t[i]
        delta_x = x[i+1] - x[i]
        delta_y = y[i+1] - y[i]

        delta_sum = delta_x + delta_y
        k = delta_sum % 2 
        j = delta_t % 2

        if -delta_t < delta_sum and delta_sum < delta_t:
            if k == 0 and j == 0:
                boolian = True
            if k == 1 and j == 1:
                boolian = True
            else:
                boolian = False
                print('No')
        else:
            boolian = False
            print('No')


if boolian == True:
    print('Yes')

Submission status: Wrong Answer

Solution code:
N = int(input())
t_before = 0
x_before = 0
y_before = 0

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

def judge(t_plus, x_diff, y_diff):
    distance = abs(x_diff) + abs(y_diff)
    if (t_plus % 2) != (distance % 2):
        return False
    if distance > t_plus:
        return False 
    return True

is_found = False

for i in range(N):
    t, x, y = travel_list[i]
    result = judge(t_plus=t-t_before, x_diff=x-x_before, y_diff=y-y_before)
    if result:
        t_before = t
        x_before = x
        y_before = y
else:
    is_found = True
if is_found:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
N = int(input())
t_before = 0
x_before = 0
y_before = 0

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

def judge(t_plus, x_diff, y_diff):
    distance = abs(x_diff) + abs(y_diff)
    if (t_plus % 2) != (distance % 2):
        return False
    if distance > t_plus:
        return False 
    return True

is_found = False

for i in range(N):
    t, x, y = travel_list[i]
    result = judge(t_plus=t-t_before, x_diff=x-x_before, y_diff=y-y_before)
    if result:
        t_before = t
        x_before = x
        y_before = y
else:
    is_found = True
if is_found:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
N = int(input())
t_before = 0
x_before = 0
y_before = 0

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

def judge(t_plus, x_diff, y_diff):
    distance = abs(x_diff) + abs(y_diff)
    if (t_plus % 2) != (distance % 2):
        return False
    if distance > t_plus:
        return False 
    return True

for i in range(N):
    t, x, y = travel_list[i]
    result = judge(t_plus=t-t_before, x_diff=x-x_before, y_diff=y-y_before)
    if result:
        t_before = t
        x_before = x
        y_before = y
    else:
        print("No")
        break
else:
    print("YES")

Submission status: Wrong Answer

Solution code:
N = int(input())
t_before = 0
x_before = 0
y_before = 0

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

def judge(t_plus, x_diff, y_diff):
    distance = abs(x_diff) + abs(y_diff)
    if (t_plus % 2) != (distance % 2):
        return False
    if distance > t_plus:
        return False 
    return True

for i in range(N):
    t, x, y = travel_list[i]
    result = judge(t_plus=t-t_before, x_diff=x-x_before, y_diff=y-y_before)
    if result:
        t_before = t
        x_before = x
        y_before = y
    if not result:
        print("No")
        break
else:
    print("YES")

Submission status: Wrong Answer

Solution code:
N = int(input())
t_before = 0
x_before = 0
y_before = 0

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

def judge(t_plus, x_diff, y_diff):
    distance = abs(x_diff) + abs(y_diff)
    if (t_plus % 2) != (distance % 2):
        return False
    if distance > t_plus:
        return False 
    return True

for i in range(N):
    t, x, y = travel_list[i]
    print(t,x,y)
    result = judge(t_plus=t-t_before, x_diff=x-x_before, y_diff=y-y_before)
    if result:
        t_before = t
        x_before = x
        y_before = y
    if not result:
        print("No")
        break
else:
    print("YES")

Submission status: Wrong Answer

Solution code:
N = int(input())
t_before = 0
x_before = 0
y_before = 0

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

def judge(t_plus, x_diff, y_diff):
    distance = abs(x_diff) + abs(y_diff)
    if (t_plus % 2) != (distance % 2):
        return False
    if distance > t_plus:
        return False 
    return True

for i in range(0,N):
    t, x, y = travel_list[i]
    result = judge(t_plus=t-t_before, x_diff=x-x_before, y_diff=y-y_before)
    if result:
        t_before = t
        x_before = x
        y_before = y
    if not result:
        print("No")
        break
else:
    print("YES")

Submission status: Wrong Answer

Solution code:
N = int(input())
t_before = 0
x_before = 0
y_before = 0

def judge(t_plus, x_diff, y_diff):
    distance = abs(x_diff) + abs(y_diff)
    if (t_plus % 2) != (distance % 2):
        return False
    if distance > t_plus:
        return False 
    return True

for i in range(N):
    t, x, y = map(int, input().split())
    result = judge(t_plus=t-t_before, x_diff=x-x_before, y_diff=y-y_before)
    if result:
        t_before = t
        x_before = x
        y_before = y
    if not result:
        print("No")
        break
else:
    print("YES")

Submission status: Wrong Answer

Solution code:
N = int(input())
t_before = 0
x_before = 0
y_before = 0

def judge(t_plus, x_diff, y_diff):
    distance = abs(x_diff) + abs(y_diff)
    if (t_plus % 2) != (distance % 2):
        return False
    if distance > t_plus:
        return False 
    return True

for i in range(N):
    t, x, y = map(int, input().split())
    result = judge(t_plus=t-t_before, x_diff=x-x_before, y_diff=y-y_before)
    if result:
        t_before = t
        x_before = x
        y_before = y
    if not result:
        print("No")
else:
    print("YES")

Submission status: Wrong Answer

Solution code:
n = int(input())

list = [list(map(int, input().split())) for x in range(n)]

t = 0
x = 0
y = 0
flag = 0

for i in range(n):
    if i>0:
        t = list[i][0] - list[i-1][0]
        d = list[i][1] - list[i-1][1] + list[i][2] - list[i-1][2]
    else:
        t = list[i][0]
        d = list[i][1] + list[i][2]
    if (t-d) >= 0 and (d-t)%2 == 0:
        continue
    else:
        flag = 1
        print('No')
        break
if flag ==0:
    print('Yes')

Submission status: Wrong Answer

Solution code:
n = int(input())

list = [list(map(int, input().split())) for x in range(n)]

t = 0
x = 0
y = 0
flag = 0

for i in range(n):
    if i>0:
        t = list[i][0] - list[i-1][0]
        d = list[i][1] - list[i-1][1] + list[i][2] - list[i-1][2]
    else:
        t = list[i][0]
        d = list[i][1] + list[i][2]
    if (d-t) >= 0 and (d-t)%2 == 0:
        continue
    else:
        flag = 1
        print('No')
        break
if flag ==0:
    print('Yes')

Submission status: Wrong Answer

Solution code:
n = int(input())

list = [list(map(int, input().split())) for x in range(n)]

t = 0
x = 0
y = 0
flag = 0

for i in range(n):
    if i>0:
        t = list[i][0] - list[i-1][0]
        d = list[i][1] - list[i-1][1] + list[i][2] - list[i-1][2]
    else:
        t = list[i][0]
        d = list[i][1] + list[i][2]
    if (t-d) >= 0 and (d-t)%2 == 0:
        continue
    else:
        flag = 1
        print('No')
        break
if flag ==0:
    print('Yes')

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline
t, x, y = 0, 0, 0
for _ in range(int(input())):
    t1, x1, y1 = map(int, input().split())
    a = x1 - x + y1 - y
    b = t1 - t
    if a <= b and a % 2 == b % 2:
        t, x, y = t1, x1, y1
    else:
        print("No")
        break
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
n = int(input())
t,x,y = 0,0,0
for i in range(n):
    T,X,Y = map(int,input().split())
    dt,dx,dy = T-t,X-x,Y-y
    if dt - (dx + dy) < 0 or (dt - (dx + dy))%2 == 1:
        print("No")
        exit()
    t,x,y = T,X,Y

print("Yes")

Submission status: Wrong Answer

Solution code:
N = int(input())
TXY = [list(map(int, input().split())) for _ in range(N)]
 
pre_t, pre_x, pre_y = 0, 0, 0
for t, x, y in TXY:
  diff_t = t - pre_t
  diff_pos = abs(x-pre_x) + abs(y-pre_y)
  if diff_t < diff_pos or diff_t - diff_pos % 2 == 1:
    print('No')
    exit()
  else:
    pre_t, pre_x, pre_y = t, x, y
print('Yes')

Submission status: Wrong Answer

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

pre_t, pre_x, pre_y = 0, 0, 0
for t, x, y in TXY:
  diff_t = t - pre_t
  diff_pos = abs(x-pre_x) + abs(y-pre_y)
  if diff_t > diff_pos or diff_pos-diff_t % 2 == 1:
    print('No')
    exit()
  else:
    pre_t, pre_x, pre_y = t, x, y
print('Yes')

Submission status: Wrong Answer

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

n = ri()
for li in [rl() for _ in range(n)]:
    t, a, b = li
    if t < a + b or t%2 != (a+b) % 2:
        print('No')
        exit()
print('Yes')

Submission status: Wrong Answer

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

n = ri()
for li in [rl() for _ in range(n)]:
    t, a, b = li
    if abs(t) < abs(a) + abs(b) or (t - a - b) & 1:
        print('No')
        exit()
print('Yes')

Submission status: Wrong Answer

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

n = ri()
for li in [rl() for _ in range(n)]:
    t, a, b = li
    if t < abs(a) + abs(b) or (t - a - b) & 1:
        print('No')
        exit()
print('Yes')

Submission status: Wrong Answer

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

n = ri()
for li in [rl() for _ in range(n)]:
    t, a, b = li
    if t < a+b or (t - a - b) & 1:
        print('No')
        exit()
print('Yes')

Submission status: Wrong Answer

Solution code:
n=int(input())
t=[0]*(n+1)
x=[0]*(n+1)
y=[0]*(n+1)
for i in range(n):
  t[i+1],x[i+1],y[i+1]=map(int,input().split())
  
  lim_t=t[i+1]-t[i]
  lim_x=x[i+1]-x[i]
  lim_y=y[i+1]-y[i]
  
  if lim_x+lim_y>lim_t or (lim_t-lim_x-lim_y)%2==1:
    print('No')
    exit()
    
print('Yes')

Submission status: Wrong Answer

Solution code:
N_str=input()
N=int(N_str)
t=[]
x=[]
y=[]
x_2=0
y_2=0
counter=0
hantei=[-1,1]
for i in range(N):
  t_1, x_1, y_1=map(int, input().split())
  t.append(t_1)
  x.append(x_1)
  y.append(y_1)
  
for i in range(N):
  x_2=0
  y_2=0
  for j in range(t[i]):
    for k in hantei:
      for l in hantei:
        x_2+=k
        y_2+=l
        if x_2==x[i] and y_2==y[i]:
          counter+=1
if counter==N:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
def dist(s1,s2):
  return abs(s1[1]-s2[1]) + abs(s1[2]-s2[2])

N=int(input())
now = (0,0,0)
for i in range(N):
  next_ = list(map(int,input().split()))
  if dist(now,next_)<=next_[0]-now[0] and dist(now,next_) % 2 == (next_[0]-now[0])%2:
    continue
  else:
    print('No')
    exit()
print('Yes')

Submission status: Wrong Answer

Solution code:
# AtCoder Beginner Contest 086
# C - Traveling

N=int(input())

T=0
X,Y=0,0

for i in range (N):
    t, x, y =map(int,input().split())
    time =t-T
    distance=(x+y)-(X+Y)
    if time >= distance and time%2==distance%2:
        T=t
        X,Y=x,y
    else :
        print("No")
        exit()

print("Yes")

Submission status: Wrong Answer

Solution code:
# AtCoder Beginner Contest 086
# C - Traveling

N=int(input())

T=0
X,Y=0,0

for i in range (N):
    t, x, y =map(int,input().split())
    time =t-T
    distance=(x+y)-(X+Y)
    if time >= distance and time%2==distance%2:
        pass
    else :
        print("No")
        exit()
print("Yes")