我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

The nearest fraction

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

https://blog.csdn.net/github_34514750/article/details/51776760?utm_source=blogxgwz4

近期文章

  • Bob's trouble
  • Adopt or not
  • Draw
  • Max Angle
  • AreYouBusy
  • EditingOperation
  • A sample Hamilton path
  • Daizhenyang's Letter
  • Bomb
  • Frost Chain
  • vb.net 获取sql数据库最后一行
  • JUnit测试报错。。。。。。。。。。。。。
  • Ext js 怎么判断sortchange事件是否执行完成
  • sql server数据库的连接
  • java 在调取方法时出错 请各位帮看看 很是不解
  • Echarts前端图,地图的图标显示比例怎么调整。官网文档找不到在哪里,求前端朋友帮忙。
  • delphi 微信企业转帐到个人银行卡
  • Android 数据绑定问题,RecyclerView绑定数据使用的model中又嵌套Model
  • C++生成DLL时附加包含目录如何处理?
  • 百度所用应用都可以用同一账号登录,原理是什么?

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华