#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 ). One day his cow Bessie discovered these delicious sod patches and wants to plant them in her secret pasture. She divides the sod into unit pieces to place them into the cells of her pasture.
Bessie is interested in how many different ways there are if she chooses four patches. If , then she has 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 .
Output Format
A single line containing one integer: the total number of ways.
4
5
Hint
Constraints: For 100% of the testdata, .
Translated by ChatGPT 5
京公网安备 11011102002149号