#P1466. [USACO2.2] 集合 Subset Sums
[USACO2.2] 集合 Subset Sums
Description
For the set of consecutive integers from , determine the number of ways to partition it into two subsets such that the sum of numbers in each subset is equal. For example, if , the set can be partitioned into two subsets with equal sums:
and is the only way (swapping the two subsets is considered the same partition, so it does not increase the total count).
If , there are four ways to partition the set into two subsets with equal sums: and . and . and . and .
Given , your program should output the total number of such partitions.
Input Format
The input contains a single line with one integer .
Output Format
Output the total number of valid partitions.
7
4
Hint
Constraints
For of the testdata, .
Translation from NOCOW.
USACO 2.2.
Translated by ChatGPT 5
京公网安备 11011102002149号