eolymp
bolt
Try our new interface for solving problems
Məsələlər

The sum of two numbers

The sum of two numbers

Here three numbers: \textbf{a}, \textbf{b}, \textbf{c}. To find out, how can you rearrange the numbers in the numbers \textbf{a} and \textbf{b}, that the amount turned \textbf{c}. \InputFile Three integers \textbf{a}, \textbf{b}, \textbf{c} (\textbf{0} < \textbf{a}, \textbf{b}, \textbf{c} < \textbf{10^9}). \OutputFile If the desired permutation of digits exist, print the word \textbf{YES}, otherwise print the word \textbf{NO}. In a case of positive response print in the second line the number \textbf{x}, obtained by the permutation of digits of \textbf{a}, and the number \textbf{y}, obtained by the permutation of digits of \textbf{b}, such that the sum of \textbf{x} and \textbf{y} is \textbf{c}. The numbers \textbf{x} and \textbf{y} must not contain leading zeros. The numbers should be separated by a space. If some solutions exist, print any.
Zaman məhdudiyyəti 1 saniyə
Yaddaşı istafadə məhdudiyyəti 64 MiB
Giriş verilənləri #1
1 899999999 999999999
Çıxış verilənləri #1
YES
1 999999998
Mənbə 2008 XIX regional school olympiad in informatics, Vologda, Problem E