Given two long integers, and , find and print a common fraction, , such that and is minimal (recall that ). If there are several fractions having minimal distance to , choose the one with the smallest denominator.
Input Format
Two space-separated long integers describing the respective values of and .
Constraints
Output Format
Print your answer in the form n/d
, where is the numerator of the fraction closest to and is the denominator of that fraction.
Sample Input 0
1 10
Sample Output 0
22/7
Explanation 0
We must check all fractions with denominators from to :
- For : , the closest fraction is and the distance is .
- For : , the closest fraction is and the distance is .
- For : , the closest fraction is and the distance is .
- For : , the closest fraction is and the distance is .
- For : , the closest fraction is and the distance is .
- For : , the closest fraction is and the distance is .
- For : , the closest fraction is and the distance is .
- For : , the closest fraction is and the distance is .
- For : , the closest fraction is and the distance is .
- For : , the closest fraction is and the distance is .
Of these, the closest approximation is with a distance to of about , so we print 22/7
as our answer.