The nearest fraction

Time Limit: 1000ms
Memory Limit: 32768KB
This problem will be judged on HDU. Original ID: 2225
64-bit integer IO format: %I64d      Java class name: Main

Description

Find the fraction closest to sqrt(N), the denominator of the fraction is no more than M.

Input

The input consists of multiple test cases.For each case the input contains two integers N and M, 1<=N<=1000000, 1<=M<=1000.

Output

For each case output one line, contaning the fraction that in the form "A/B" where A and B are positive integers with no common factors greater than one.

Sample Input

9 4

Sample Output

3/1
Language: 
Theme: 
Share Code? 

Powered by NB231 | Current Style: .