Fractions#1269

Fractions

1 second
16 megabytes
Medium

A fraction \frac{a}{b} (0 < a < b \leq 100) can be represented as a sum of unit fractions:

\frac{1}{b_1} + \frac{1}{b_2} + \ldots + \frac{1}{b_n}.

Find such a representation where the sum b_1 + b_2 + \ldots + b_n is minimized.

Input

Each test case contains two positive integers and (0 < a < b \leq 100).

Output

For each test case, output the minimal sum.

Examples

Example 1

Loading
Loading