F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

The nearest fraction

Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 884    Accepted Submission(s): 190


Problem 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
 

Author
8600
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-04-26 11:00:19, Gzip enabled