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

近期文章

  • ShaDan’ Problem
  • jquery的滚动监听事件
  • 启动配置JUnitCore引用不存在的项目scm32?
  • 服务器无法无法保存session
  • hadoop 集群中ResourceManager节点丢失
  • sqlserver 不能调用函数
  • owncloud上传文件失败,和本地文件夹连接失败
  • 新人求助~内存释放问题
  • tcp keepalive设置时需不需要客户端和服务器端都设置
  • 怎么用js动态给Input标签添加jstl标签
  • python中正则表达式一题
  • 关于IDEA运行javaweb的问题
  • 能不能大神帮我看一下我这一小段JS代码为什么运行不了..!!
  • 一台ntp server服务器 同时能支持多少台ntp客户端做时间同步?
  • __alloc_skb()分配内存问题
  • Spark提交作业如何给main函数输入参数
  • 请问,如何在tomcat启动时,将自己的自定义信息打印到控制台?
  • Mouse
  • Repair the Wall
  • maven管理oracle的问题(小弟C币不多,请大佬解惑,别留链接!)

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

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

友情链接:代码精华