#P2236. [HNOI2002] 彩票
[HNOI2002] 彩票
Description
A set of lottery tickets is issued in a certain place. Each ticket displays the natural numbers from to . A player may circle any distinct numbers among these numbers. Each player can buy only one ticket, and different players choose different sets.
Each draw picks two natural numbers and . If, on someone's ticket, the sum of the reciprocals of the selected natural numbers is exactly equal to , then they will receive a souvenir.
Given the draw result and , determine how many souvenirs must be prepared to ensure all winners can be awarded.
Input Format
The input contains exactly one line with four integers , , , separated by spaces.
Output Format
Output one line with the required number of souvenirs.
2 4 3 4
1
Hint
, , .
The input guarantees the output does not exceed .
Translated by ChatGPT 5
京公网安备 11011102002149号