Sum
Time limit2sMemory limit1024 MB
Given three huge numbers A, B, and C, the task asks whether zeros can be appended to A and B so that their sum equals C, and to print the counts.
- Level
Medium4 of 10
- Topics
- String, Implementation, Math
- Solved
- No attempts yet
Statement
Vasya likes to look for patterns in everything. His notebook has three numbers , , and , and he wants to find a simple relation between them. First, he wants to know whether zeros can be appended to the ends of these numbers so that the sum of the first two equals the third. For example, if his notebook has 9, 34, and 43, he does not need to append any zeros, because 9 + 34 is already 43. If the notebook has 23, 7, and 93, he can append a zero to 7 to get 70. Then 23 + 70 = 93.
You are given three positive integers , , and . Find non-negative integers , , and such that .
Input
The first line contains the number , the second line contains , and the third line contains . Every number is at least 1 and at most .
Output
If there are numbers , , and that satisfy the condition, print YES on the first line and the numbers , , and on the second line. The numbers must be non-negative and must not exceed . If there are several solutions, print any of them. If no such numbers exist, print NO.