我爱占星网 我爱占星网
首页
编程
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

http://www.acmerblog.com/hdu-2225-the-nearest-fraction-3455.html

近期文章

  • 安装完毕,首次分享出现的问题
  • json错误问题,求大神帮忙,万分感谢
  • 各位大神们,新手有问题请教一下
  • vb.net 获取ftp随机文件出问题
  • A New Tetris Game
  • Two Brothers
  • 在iphone中将 UITextView转换为pdf文件
  • android-webview中的本地图片
  • 应用在iPhone4和iPhone5的问题
  • 如何读取手机中相册的图像文件
  • 在多个EditText字段实现TextWatcher的接口
  • 像照相机的闪光灯效果怎么触发?
  • 学Android和iOS推荐看什么书?
  • android 的ListView中,如何判断其内容已滚动到最顶部或者最底部?
  • Android模拟器无法启动,提示“invalid command-line parameter”
  • 求webview显示HTML代码中文乱码的解决办法
  • 自定义获取总是得到空值
  • 使用NSUInteger遇到的问题
  • iPhone-自定义动作栏的问题
  • android怎么确定对话框返回的值是true还是false?

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

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

友情链接:代码精华