F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

A + B = C

Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/Others)
Total Submission(s): 2576    Accepted Submission(s): 602
Special Judge


Problem Description
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, c$ , find an arbitrary set of $x, y, z$ such that $a\cdot 10^x+b\cdot 10^y=c\cdot 10^z$ and $0 \le x, y, z \le 10^6$.
 

Input
The input consists of multiple test cases, starting with an integer $t$ ($1 \le t \le 100$), denoting the number of test cases.

For each test case, there are three space-separated integers, $a, b, c$ respectively ($1 \le a, b, c \le 10^{100000}$).
 

Output
For each test case, please output three space-separated integers $x, y, z$. If there are multiple solutions, print any of them.

In case there are no solutions, please output $-1$ as a single line.
 

Sample Input
3 23 39 62 2 31 51 1 1 1
 

Sample Output
0 0 0 1 0 0 -1
 

Hint

HDOJ may give ambiguous feedback due to the compatibility issue of our checker. If you see "System Error", please think of it as "Wrong Answer".
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-22 09:29:34, Gzip enabled