#C6039. Distinct Cells Reachable After N Steps
Distinct Cells Reachable After N Steps
Distinct Cells Reachable After N Steps
Alice is standing on an infinite 2D grid. In one move, she can move to any adjacent cell, including the diagonals. After exactly n moves, the cells that can be reached form a square with side length \((2n+1)\). Hence, the number of distinct cells Alice can reach is given by the formula: \((2n+1)^2\).
Your task is to compute this number given an integer n
provided as input.
inputFormat
The input is read from standard input (stdin) and consists of a single integer n
(0 ≤ n ≤ 10^9
), which represents the number of steps.
outputFormat
Output a single integer to standard output (stdout), representing the number of distinct cells reachable after exactly n
steps. This value is computed as \((2n+1)^2\).
1
9