#P2277. [HNOI2003] 24点游戏
[HNOI2003] 24点游戏
Description
To develop children's arithmetic skills, adults often have them play the following game: draw any cards from a deck of playing cards, and ask the child to use +, -, *, /, and parentheses to form a valid expression whose value is . This game is called the "24 game".
Given any four integers , , , , compute how many different expressions with value can be formed from these integers.
Input Format
The input contains one line with four integers , , , ().
Output Format
Output the number of expressions equal to that can be formed from , , , . If there are none, output .
5 5 5 5
1
Hint
Translated by ChatGPT 5
京公网安备 11011102002149号