当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

2659:Cheat

题目描述
In the summer of last year, Lemon, Yifenfei and CTW live in the same apartment. They usually played some game after they came back from lab. One day, Yifenfei came up with an idea about a new game. That game's rules are as follows:
Yifenfei provides a positive integer n, Lemon and CTW should give 3 positive integers x, y and z in a limited time. The winner is who make the |n - x * y * z| as small as possible. If the value of |n - x * y * z| is tied, the rusult is determined by smaller x, then smaller y, then smaller z, until the winner appear. To make this game more diffcult, Yifenfei will also give a list of positive integers, x, y and z cannot be included in this list.
Because Lemon is so smart, CTW never win even one game. Can you provides CTW a program to help him to get the optimum answer?
输入解释
Input includes several cases. The first line of a case contains two integers t, n. Then follows t positive integers in the seconde line.Input ends with a case t = 0 and n = 0. 0 <= t <= 50, 0 < n <= 1000.
输出解释
Every case print three positive integers x, y, z.
输入样例
1 1
1
2 10
1 2
0 0
输出样例
2 2 2
3 3 3
来自杭电HDUOJ的附加信息
Author CTW
Recommend yifenfei

该题目是Virtual Judge题目,来自 杭电HDUOJ

题目来源 决战龙虎门

源链接: HDU-2659

最后修改于 2020-10-25T22:55:37+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
10000/5000MS(Java/Others) 32768/32768K(Java/Others)