The sum of two numbers
Medium
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
Here three numbers: a, b, c. To find out, how can you rearrange the numbers in the numbers a and b, that the amount turned c.
Input
Three integers a, b, c (0 < a, b, c < 10^9).
Output
If the desired permutation of digits exist, print the word YES, otherwise print the word NO. In a case of positive response print in the second line the number x, obtained by the permutation of digits of a, and the number y, obtained by the permutation of digits of b, such that the sum of x and y is c. The numbers x and y must not contain leading zeros. The numbers should be separated by a space. If some solutions exist, print any.
Examples
Input #1
Answer #1
Submissions 658
Acceptance rate 15%