欢迎来到起遇信息学
起遇信息学正处于上线筹建阶段,以下功能已全部开放免费体验: ✅ 完整题库浏览与代码提交评测(C / C++ / Python / Java 等) ✅ 入门到进阶的系列课程试读、作业与考试 ✅ AI 提示、AI 作业分析等智能助教功能 ✅ 赛事模拟与个人能力报告 ✅ 邮箱注册开放 ⏳ 付费课程订阅与微信/支付宝支付通道 ⏳ 手机号登录,微信扫码登录、微信公众号绑定 使用中如遇任何问题,欢迎通过页面底部 **"联系我们"** 与我们沟通。
CF1690A.Print a Pedestal (Codeforces logo?)
Print a Pedestal (Codeforces logo?)
Given the integer — the number of available blocks. You must use all blocks to build a pedestal.
The pedestal consists of platforms for -nd, -st and -rd places respectively. The platform for the -st place must be strictly higher than for the -nd place, and the platform for the -nd place must be strictly higher than for the -rd place. Also, the height of each platform must be greater than zero (that is, each platform must contain at least one block).
Example pedestal of blocks: second place height equals blocks, first place height equals blocks, third place height equals blocks.
Among all possible pedestals of blocks, deduce one such that the platform height for the -st place minimum as possible. If there are several of them, output any of them.
Input
The first line of input data contains an integer () — the number of test cases.
Each test case contains a single integer () — the total number of blocks for the pedestal. All blocks must be used.
It is guaranteed that the sum of values over all test cases does not exceed .
Output
For each test case, output numbers — the platform heights for -nd, -st and -rd places on a pedestal consisting of blocks (, ).
Among all possible pedestals, output the one for which the value of minimal. If there are several of them, output any of them.
Note
In the first test case we can not get the height of the platform for the first place less than , because if the height of the platform for the first place is not more than , then we can use at most blocks. And we should use blocks. Therefore, the answer 4 5 2 fits.
In the second set, the only suitable answer is: 2 3 1.
Samples
6
11
6
10
100000
7
8
4 5 2
2 3 1
4 5 1
33334 33335 33331
2 4 1
3 4 1
在线编程 IDE
建议全屏模式获得最佳体验
| 进入全屏编程 | Alt+E |
| 递交评测 | Ctrl+Enter |
| 注释/取消注释 | Ctrl+/ |
| 缩放字体 | Ctrl+滚轮 |