#P1479. 宿舍里的故事之五子棋
宿舍里的故事之五子棋
Description
There are lots and lots of fun things in the dormitory!
Today 7890653 saw Gomoku, which had unknowingly become popular. In the dorm, they took a notebook, drew some squares, and a board was ready.
When 7890653 looked at the board, an idea came to mind...
On a board, place stones, where ; the stones can be placed anywhere on the board, but they cannot overlap. Thus, there may be five stones forming a row, a column, or lying on the same diagonal. Different placements may produce different numbers of five-in-a-row lines.
Your task: given , find all possible counts of five-in-a-row lines that can appear over different placements (counting full lines among the 5 rows, 5 columns, and 2 diagonals). For example, when , we have:

Only these two nonnegative values occur (note that values are not repeated). You should output the sum of these distinct values.
That is, .
Input Format
The input contains one line with a single integer , as described. Guaranteed .
Output Format
Output the sum of all possible values. It is easy to see that .
11
3
Hint
Translated by ChatGPT 5
京公网安备 11011102002149号