Problem 3029 --A + B = C

3029: A + B = C

"
Time Limit $2$ 秒/Second(s) Memory Limit $512$ 兆字节/Megabyte(s)
提交总数 $6$ 正确数量 $0$
裁判形式 标准裁判/Standard Judge 我的状态 尚未尝试
难度 分类标签
Hi everyone! Welcome to the Stage 7 of this series of training contests. Cuber QQ is the problem settler of this contest; he has prepared 11 problems for you and wishes you to enjoy it. Good luck! 

As the first problem of this contest, Cuber QQ thought that it's reasonable to start with an easy one, so he modified the famous A + B problem by a little bit, so that it's easy enough but not that trivial. 

Given a,b,ca,b,c , find an arbitrary set of x,y,zx,y,z such that a⋅10x+b⋅10y=c⋅10za⋅10x+b⋅10y=c⋅10z and 0≤x,y,z≤1060≤x,y,z≤106.
The input consists of multiple test cases, starting with an integer tt (1≤t≤1001≤t≤100), denoting the number of test cases. 

For each test case, there are three space-separated integers, a,b,ca,b,c respectively (1≤a,b,c≤101000001≤a,b,c≤10100000).
For each test case, please output three space-separated integers x,y,zx,y,z. If there are multiple solutions, print any of them. 

In case there are no solutions, please output −1−1 as a single line.
3
23 39 62
2 31 51
1 1 1
0 0 0
1 0 0
-1

推荐代码 查看3029 所有题解 上传题解视频得图灵币

本题记录 用 户(点击查看用户) 运行号(点击购买题解) 时 间
算法最快[$ $ms]
内存最少[$ $KB]
第一AC
第一挑战 淡意的温柔 591110 2020-06-06 08:02:09

赛题来源/所属竞赛 2019 Multi-University Training Contest 7 N/A

竞赛编号 竞赛名称 竞赛时间 访问比赛