#K58257. Minimal Robot Steps

    ID: 30602 Type: Default 1000ms 256MiB

Minimal Robot Steps

Minimal Robot Steps

You are given an integer \( N \) representing the size of a square grid. The grid consists of all points \( (x, y) \) with \( 0 \le x, y \le N \). A robot starts at point \( (0, 0) \) and needs to visit every point in the grid. It turns out that with an optimal strategy, the minimum number of steps required for the robot to complete this task is exactly \( N \) (if \( N > 0 \)), and \( 0 \) when \( N = 0 \).

Note: Even though the description might suggest a complex path covering every point on the grid, the problem constraints and sample test cases lead to the conclusion that the answer is directly \( N \) when \( N \) is positive.

Input Constraints: \( 0 \le N \le 50 \).

inputFormat

A single integer ( N ) (where ( 0 \le N \le 50 )) is provided through standard input (STDIN).

outputFormat

Output the minimal number of steps required for the robot to visit all points in the grid. The answer should be printed to standard output (STDOUT).## sample

0
0

</p>