#P1754. 球迷购票问题
球迷购票问题
Description
A grand football match is about to take place. A long line of fans has formed at the ticket office.
According to the rules of the ticket office, each buyer may purchase at most one ticket, and each ticket costs yuan. In the line, there are people holding -yuan bills and another people holding -yuan bills. Suppose the ticket office has no change at the start of sales. How many queueing orders of these fans will ensure the ticket office never faces the embarrassment of being unable to make change?
For example, when , let A denote a fan holding a -yuan bill and B denote a fan holding a -yuan bill. Then there are at most the following two different queueing orders that ensure the clerk can always make change.
- First: .
- Second: .
Given , compute how many queueing orders of fans will ensure the ticket office can always make change.
Input Format
A single integer representing the value of .
Output Format
A single integer, the number of valid queueing orders.
2
2
Hint
Constraints and Conventions
For all testdata, .
Translated by ChatGPT 5
京公网安备 11011102002149号