#P6184. [USACO08OCT] Building A Fence G

[USACO08OCT] Building A Fence G

Description

How many different cutting methods are there such that the four cut boards can form a four-sided fence.

Note:

  1. Do not consider symmetry. You do not need to remove symmetric cases or deal with other similar complicated issues.
  2. The area enclosed by the fence must be greater than 00.
  3. The result fits in a 32-bit integer.

Input Format

One integer NN.

Output Format

The number of ways Farmer John can split the board and make a quadrilateral.

6
6

Hint

Farmer John has 1010 ways to cut the board into four pieces:

  • (1, 1, 1, 3);
  • (1, 1, 2, 2);
  • (1, 1, 3, 1);
  • (1, 2, 1, 2);
  • (1, 2, 2, 1);
  • (1, 3, 1, 1);
  • (2, 1, 1, 2);
  • (2, 1, 2, 1);
  • (2, 2, 1, 1);
  • (3, 1, 1, 1)。

Among them, there are four cases that cannot form a quadrilateral:

  • (1, 1, 1, 3),
  • (1, 1, 3, 1),
  • (1, 3, 1, 1),
  • (3, 1, 1, 1)。

Translated by ChatGPT 5