#P2158. [SDOI2008] 仪仗队

    ID: 1136 远端评测题 1000ms 125MiB 尝试: 3 已通过: 2 难度: 7 上传者: 标签>数学2008各省省选山东素数判断,质数,筛法最大公约数,gcd

[SDOI2008] 仪仗队

Description

As the sports committee member, Mr. C is responsible for training the honor guard for this sports meet. The honor guard is an N×NN \times N square formation of students. To ensure the formation marches in perfect order, Mr. C follows at the back-left of the formation and judges whether it is neat based on the number of students visible to him (as shown in the figure).

Now, Mr. C wants you to tell him the number of students he can see when the formation is neat.

Input Format

One line with a positive integer NN.

Output Format

Output one line with a single number: the number of students Mr. C should see.

4
9

Hint

Constraints: For 100%100\% of the testdata, 1N400001 \le N \le 40000.

Translated by ChatGPT 5