Problem: The queen on the ACSL chess board is the most versatile piece. It can move at most N cells (where N is determined at the start of each game) in the following directions:
1. Left or Right to the borders of the chess board
2. Up or Down to the borders of the chess board
3. Diagonally to the borders of the chess board
Since the queen can range in so many directions to capture an opponent’s pieces, where can those pieces be safely placed? The ACSL chess board will be a 5x5 grid as labeled and shown above.
Input: There will be five lines of input. Each line will give the location of the queen as an ordered pair in a row, column order and the value of N.
Output: Print the number of locations where a chess piece is safe from capture.