UVA - 10976:Fractions Again?!

该博客讨论了如何找到每个形式为 1/k(k > 0)的分数对应的两个正整数 x 和 y,使得 1/k = 1/x + 1/y。它提出编写程序来计算任意给定 k 的 (x, y) 对的数量,并给出了输入、输出格式以及样例。博客还包含一些具体的 k 值及其对应的 x 和 y 值的示例。" 83443782,7693710,藏书馆APP:阅读、交流与共享的书香平台,"['移动阅读', '出版书籍', '用户分析', '产品分析', 'APP']

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Fractions Again?!

标签:

来源:

参考资料:

相似题目:

题目

It is easy to see that for every fraction in the form 1 k (k > 0), we can always find two positive integers x and y, x ≥ y, such that:
1/k = 1/x + 1/y
Now our question is: can you write a program that counts how many such pairs of x and y there are for any given k?

输入

Input contains no more than 100 lines, each giving a value of k (0 < k ≤ 10000).

输出

For each k, output the number of corresponding (x, y) pairs, followed by a sorted list of the values of x and y, as

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

wingrez

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值