题库练习 Donut Shops
← 上一题 下一题 →

A13661 | Donut Shops

时间限制1s
内存限制256MB
通过 / 提交0/0

题目描述

There are two rival donut shops.

The first shop sells donuts at retail: each donut costs $a$ dollars.

The second shop sells donuts only in bulk: box of $b$ donuts costs $c$ dollars. So if you want to buy $x$ 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 $x$ .

You want to determine two positive integer values:

1. how many donuts can you buy so that they are strictly cheaper in the first shop than in the second shop?
2. 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 $-1$ . If there are multiple possible answers, then print any of them.

The printed values should be less or equal to $10^9$ . It can be shown that under the given constraints such values always exist if any values exist at all.

输入格式

The first line contains a single integer $t$ ( $1 \le t \le 1000$ ) — the number of testcases.

Each of the next $t$ lines contains three integers $a$ , $b$ and $c$ ( $1 \le a \le 10^9$ , $2 \le b \le 10^9$ , $1 \le c \le 10^9$ ).

输出格式

For each testcase print two positive integers. For both shops print such $x$ that buying $x$ donuts in this shop is strictly cheaper than buying $x$ donuts in the other shop. $x$ should be greater than $0$ and less or equal to $10^9$ .

If there is no such $x$ , then print $-1$ . If there are multiple answers, then print any of them.

输入输出样例

输入 #1
4
5 10 4
4 5 20
2 2 3
1000000000 1000000000 1000000000
输出 #1
-1 20
8 -1
1 2
-1 1000000000
C++ 编辑器
输入
输出