#P2277. [HNOI2003] 24点游戏

[HNOI2003] 24点游戏

Description

To develop children's arithmetic skills, adults often have them play the following game: draw any 44 cards from a deck of playing cards, and ask the child to use +, -, *, /, and parentheses to form a valid expression whose value is 2424. This game is called the "24 game".

Given any four integers aa, bb, cc, dd, compute how many different expressions with value 2424 can be formed from these 44 integers.

Input Format

The input contains one line with four integers aa, bb, cc, dd (0a,b,c,d1000 \le a, b, c, d \le 100).

Output Format

Output the number of expressions equal to 2424 that can be formed from aa, bb, cc, dd. If there are none, output 00.

5 5 5 5

1

Hint

Translated by ChatGPT 5