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

建议使用的浏览器:

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

5610:Baby Ming and Weight lifting

题目描述
Baby Ming is fond of weight lifting. He has a barbell pole(the weight of which can be ignored) and two different kinds of barbell disks(the weight of which are respectively $a$ and $b$), the amount of each one being infinite.

Baby Ming prepare to use this two kinds of barbell disks to make up a new one weighted $C$(the barbell must be balanced), he want to know how to do it.

输入解释
In the first line contains a single positive integer $T$, indicating number of test case.

For each test case:

There are three positive integer $a, b$, and $C$.

$1 \leq T \leq 1000, 0 < a, b, C \leq 1000, a \neq b$
输出解释
For each test case, if the barbell weighted $C$ can’t be made up, print Impossible.

Otherwise, print two numbers to indicating the numbers of $a$ and $b$ barbell disks are needed. (If there are more than one answer, print the answer with minimum $a+b$)
输入样例
2
1 2 6
1 4 5 
输出样例
2 2
Impossible
来自杭电HDUOJ的附加信息
Recommend hujie

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

源链接: HDU-5610

最后修改于 2020-10-25T23:24:10+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 65536/65536K(Java/Others)