####準備
[C#でAtCoderデビューのための準備]
(https://qiita.com/azumabashi/items/7aa9e4b77c10970cc30a)
のあとで AtCoder Beginners Selection をやってみました。
####問題文
ABC086C - Traveling
[https://atcoder.jp/contests/abs/tasks/arc089_a]
(https://atcoder.jp/contests/abs/tasks/arc089_a)
####提出結果
using System;
using System.Linq;
class Program
{
static void Main(string[] args)
{
int N = int.Parse(Console.ReadLine());
string result = "Yes";
int tBefore = 0;
int xBefore = 0;
int yBefore = 0;
for (int i = 0; i < N; i++)
{
string[] input = Console.ReadLine().Split(' ');
if (result != "No")
{
int t = Math.Abs(int.Parse(input[0]) - tBefore);
int x = Math.Abs(int.Parse(input[1]) - xBefore);
int y = Math.Abs(int.Parse(input[2]) - yBefore);
if ((t - (x + y)) < 0)
{
result = "No";
}
else if ((t - (x + y)) % 2 != 0)
{
result = "No";
}
tBefore = t;
xBefore = x;
yBefore = y;
}
}
Console.WriteLine($"{result}");
}
}