欢迎来到起遇信息学
起遇信息学正处于上线筹建阶段,以下功能已全部开放免费体验: ✅ 完整题库浏览与代码提交评测(C / C++ / Python / Java 等) ✅ 入门到进阶的系列课程试读、作业与考试 ✅ AI 提示、AI 作业分析等智能助教功能 ✅ 赛事模拟与个人能力报告 ✅ 邮箱注册开放 ⏳ 付费课程订阅与微信/支付宝支付通道 ⏳ 手机号登录,微信扫码登录、微信公众号绑定 使用中如遇任何问题,欢迎通过页面底部 **"联系我们"** 与我们沟通。
CF1679A.AvtoBus
AvtoBus
Spring has come, and the management of the AvtoBus bus fleet has given the order to replace winter tires with summer tires on all buses.
You own a small bus service business and you have just received an order to replace tires. You know that the bus fleet owns two types of buses: with two axles (these buses have wheels) and with three axles (these buses have wheels).
You don't know how many buses of which type the AvtoBus bus fleet owns, so you wonder how many buses the fleet might have. You have to determine the minimum and the maximum number of buses that can be in the fleet if you know that the total number of wheels for all buses is .
Input
The first line contains an integer () — the number of test cases. The following lines contain description of test cases.
The only line of each test case contains one integer () — the total number of wheels for all buses.
Output
For each test case print the answer in a single line using the following format.
Print two integers and () — the minimum and the maximum possible number of buses that can be in the bus fleet.
If there is no suitable number of buses for the given , print the number as the answer.
Note
In the first test case the total number of wheels is . It means that there is the only one bus with two axles in the bus fleet.
In the second test case it's easy to show that there is no suitable number of buses with wheels in total.
In the third test case the total number of wheels is . The following options are possible:
- Four buses with three axles.
- Three buses with two axles and two buses with three axles.
- Six buses with two axles.
So the minimum number of buses is and the maximum number of buses is .
Samples
4
4
7
24
998244353998244352
1 1
-1
4 6
166374058999707392 249561088499561088
在线编程 IDE
建议全屏模式获得最佳体验
| 进入全屏编程 | Alt+E |
| 递交评测 | Ctrl+Enter |
| 注释/取消注释 | Ctrl+/ |
| 缩放字体 | Ctrl+滚轮 |