P17506 [Beginner Contest #52] Sharing Mooncakes

Description

The Mid-Autumn Festival is here, and the teachers of Luogu Kindergarten are going to share mooncakes with the children. The kindergarten has $a$ senior-class children, each of whom wants to eat $\frac{1}{3}$ of a mooncake, and $b$ middle-class children, each of whom wants to eat $\frac{1}{4}$ of a mooncake. Mooncakes can be cut into pieces of any size, but the teachers can only prepare whole mooncakes. To satisfy all the children, the total amount of mooncakes prepared must be at least the total amount the children want to eat. Calculate the minimum number of whole mooncakes the teachers need to prepare.

Input Format

The input contains one line with two non-negative integers $a,b$, the numbers of senior-class and middle-class children, respectively.

Output Format

Output a single integer, the minimum number of whole mooncakes needed.

Explanation/Hint

### Sample 1 Explanation The $3$ senior-class children need $3\times \frac{1}{3}=1$ mooncake in total; the $4$ middle-class children need $4\times \frac{1}{4}=1$ mooncake in total. So $2$ mooncakes are needed in total. ### Sample 2 Explanation All the children need $\frac{1}{3}+\frac{1}{4}=\frac{7}{12}$ of a mooncake in total. Since only whole mooncakes can be prepared, at least $1$ mooncake is needed. ### Constraints There are $20$ test points in this problem. - For test points $1\sim 4$, $a$ is a multiple of $3$; - For test points $5\sim 8$, $b$ is a multiple of $4$; - For test points $9, 10$, $a=0$; - For test points $11, 12$, $b=0$; - For all test points, $0\leq a,b\leq 1000$. Translated by QwenWork