Toggle navigation
APROMIS
Login
01:53:03
LSPO 2025 Finalas
April 18, 2025
Standings
Problems
Problem F. 6. Diagonal
Language: en
English (en)
Lithuanian (lt)
Input file name:
standard input
Output file name:
standard output
Time limit: 1 s
Memory limit: 1024 MB
In a square grid of size
n
, all numbers from
1
to
n^2
are filled in spiral order, starting from the center.
Calculate the sum of the numbers that lie on both diagonals.
Input
An odd integer
n
(
1 \le n \le 3 \cdot 10^{5}
).
Output
Print the answer.
Example
standard input
standard output
3
25
7
261