Logo
(追記) (追記ここまで)

7160번 - Puzzle of numbers 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB29000.000%

문제

When a part of digits in a correct equation of sum of two numbers is replaced with stars (*), a puzzle of numbers is formed. Thus, for example, if the starting equation was the following:

 9334
 789
-------
 10123 (9334 +たす 789 = 10123),

then puzzles corresponding to it are:

 *3*4 9**4 ****
 78* **9 ***
------- ------- -------
 10123 ***** *****

as well as many more.

Your task is to write a program that would find the starting equation for a given puzzle. If there is more than one starting equation possible, your task is to find one of these.

It is known that all the puzzles given will have at least one solution and in the starting equation the first digit of any numbers is not equal to 0.

입력

The standard input contains three lines. Each line contains a string containing digits and * signs. The length of any of the strings does not exceed 20 symbols. The first and the second line of the file contain the numbers to be added and the third line the sum.

출력

The standard output must contain exactly three lines, corresponding to the starting equation. Each of these must contain one positive integer. The first and the second lines of the file must contain the numbers to be added and the third line the sum.

제한

예제 입력 1

*3*4
78*
10123

예제 출력 1

9334
789
10123

힌트

출처

Olympiad > Latvian olympiad in informatics > 13th Latvian olympiad in informatics > Stage III (Country) 2번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /