eolymp
bolt
Try our new interface for solving problems
Problems

Fractions

Fractions

Time limit 1 second
Memory limit 16 MiB

A fraction a/b (a < b) can be expressed in the way

1/b_1 + 1/b_2 + ... + 1/b_n.

Now can you achieve it and make the sum of b_1 to b_n minimum?

Input data

For each case there are tow positive intergers a and b (0 < a < b100).

Output data

For each test case output the minimum sum.

Examples

Input example #1
2 3
3 4
4 15
Output example #1
6
6
16