#P2666. [USACO07OCT] Bessie's Secret Pasture S

[USACO07OCT] Bessie's Secret Pasture S

Description

Farmer John recently harvested an almost infinite number of sod patches and stacked them in an open area. These patches are all squares with nonnegative integer side lengths (including 00). One day his cow Bessie discovered these delicious sod patches and wants to plant them in her secret pasture. She divides the sod into 1×11\times1 unit pieces to place them into the NN cells of her pasture.

Bessie is interested in how many different ways there are if she chooses four patches. If N=4N=4, then she has 55 different ways: (1,1,1,1), (2,0,0,0), (0,2,0,0), (0,0,2,0), (0,0,0,2); the numbers in parentheses denote side lengths. Note that order matters; for example, (1,2,3,4) and (4,3,2,1) are two different ways.

Input Format

A single line with one integer NN.

Output Format

A single line containing one integer: the total number of ways.

4
5

Hint

Constraints: For 100% of the testdata, 1N100001\le N\le10000.

Translated by ChatGPT 5