欢迎来到起遇信息学
起遇信息学正处于上线筹建阶段,以下功能已全部开放免费体验: ✅ 完整题库浏览与代码提交评测(C / C++ / Python / Java 等) ✅ 入门到进阶的系列课程试读、作业与考试 ✅ AI 提示、AI 作业分析等智能助教功能 ✅ 赛事模拟与个人能力报告 ✅ 邮箱注册开放 ⏳ 付费课程订阅与微信/支付宝支付通道 ⏳ 手机号登录,微信扫码登录、微信公众号绑定 使用中如遇任何问题,欢迎通过页面底部 **"联系我们"** 与我们沟通。
CF1373A.Donut Shops
Donut Shops
There are two rival donut shops.
The first shop sells donuts at retail: each donut costs dollars.
The second shop sells donuts only in bulk: box of donuts costs dollars. So if you want to buy donuts from this shop, then you have to buy the smallest number of boxes such that the total number of donuts in them is greater or equal to .
You want to determine two positive integer values:
- how many donuts can you buy so that they are strictly cheaper in the first shop than in the second shop?
- how many donuts can you buy so that they are strictly cheaper in the second shop than in the first shop?
If any of these values doesn't exist then that value should be equal to . If there are multiple possible answers, then print any of them.
The printed values should be less or equal to . It can be shown that under the given constraints such values always exist if any values exist at all.
Input
The first line contains a single integer () — the number of testcases.
Each of the next lines contains three integers , and (, , ).
Output
For each testcase print two positive integers. For both shops print such that buying donuts in this shop is strictly cheaper than buying donuts in the other shop. should be greater than and less or equal to .
If there is no such , then print . If there are multiple answers, then print any of them.
Note
In the first testcase buying any number of donuts will be cheaper in the second shop. For example, for or donuts you'll have to buy a box of donuts for dollars. or donuts in the first shop would cost you or dollars, respectively, however. For donuts you'll have to buy two boxes for dollars total. Note that and are also valid answers for the second shop, along with many other answers.
In the second testcase buying any number of donuts will be either cheaper in the first shop or the same price. donuts cost dollars in the first shop and dollars in the second shop (because you have to buy two boxes). donuts will cost dollars in both shops, so is not a valid answer for any of the shops.
In the third testcase donut costs and dollars, respectively. donuts cost and dollars. Thus, is a valid answer for the first shop and is a valid answer for the second shop.
In the fourth testcase donuts cost dollars in the first shop and dollars in the second shop.
Samples
4
5 10 4
4 5 20
2 2 3
1000000000 1000000000 1000000000
-1 20
8 -1
1 2
-1 1000000000
在线编程 IDE
建议全屏模式获得最佳体验
| 进入全屏编程 | Alt+E |
| 递交评测 | Ctrl+Enter |
| 注释/取消注释 | Ctrl+/ |
| 缩放字体 | Ctrl+滚轮 |