using System; using System.Numerics; using System.Collections.Generic; using System.Linq; namespace Program { class Program { static void Main(string[] args) { var numOfTurn = int.Parse(Console.ReadLine()); var s = new Shougi(); s.Draw(); for (int i = 0; i < numOfTurn; i++) { var input = Console.ReadLine().Split(' '); var tCol = int.Parse(input[0]) - 1; var tRow = int.Parse(input[1]) - 1; var dCol = int.Parse(input[2]) - 1; var dRow = int.Parse(input[3]) - 1; s.Move(tRow, tCol, dRow, dCol); } if (s.IsMuteki()) { Console.WriteLine("YES"); } else { Console.WriteLine("NO"); } } } public class Shougi { public string[,] Board; public int Size; public Shougi() { Board = new string[9, 9]; Size = Board.GetLength(0); for (int row = 0; row < Size; row++) { for (int col = 0; col < Size; col++) { Board[row, col] = "0"; } } // 初期配置 Board[7, 1] = "A"; Board[8, 2] = "B"; Board[8, 6] = "C"; } public void Move(int targetRow, int targetCol, int destRow, int destCol) { if (Board[targetRow, targetCol] != "A" && Board[targetRow, targetCol] != "B" && Board[targetRow, targetCol] != "C") { return; } Board[destRow, destCol] = Board[targetRow, targetCol]; Board[targetRow, targetCol] = "0"; } public void Draw() { for (int row = 0; row < Size; row++) { var line = ""; for (int col = 0; col < Size; col++) { line += Board[row, col] == "" ? "0" : Board[row, col]; } Console.WriteLine(line); } } public bool IsMuteki() { return Board[7, 4] == "A" && Board[7, 3] == "B" && Board[7, 5] == "C"; } } }