HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Problems from Olympiads.ru > problem:


272. 50707 - Rebus

Volume problems

• 147. 50251 - Symmetric matrix
• 213. 50769 - Arithmetic expression
• 217. 50253 - Timer
• 133. 50239 - Eating cheese
• 159. 50668 - Triangle
• 206. 50252 - Birthday
• 234. 50249 - Ladders
• 235. 50250 - The Knight
• 272. 50707 - Rebus
• 240. 50247 - Missing numbers
• 275. 50691 - The traveling salesma...

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb. Difficulty Beta

Write a program that finds all solutions of the puzzle ABCD + DCBA = CEEC.

Rebus is known to be a replacement of numbers by letters; each letter is replaced by a digit from 1 to 6 (other figures in this puzzle are not allowed) so that the written equality is true. Different letters correspond to different numbers.

Input
You can assume that the input in this problem does not exist (On the other hand that line will be recorded as solvable puzzle).
Output
Bring out puzzles. Each solution on a separate line. Solution is displayed in the form of equality, the corresponding described puzzle in which all letters are replaced by numbers.

Example (for another puzzle)
If we solved the puzzle, A + B = CD, (and if admitted the numbers 1 to 9), then conclusion would be (to reduce space is divided into columns):
3 +9 = 12
4 +8 = 12
4 +9 = 13
5 +7 = 12
5 +8 = 13
5 +9 = 14
6 +7 = 13
6 +8 = 14
6 +9 = 15
7 +5 = 12
7 +6 = 13
7 +8 = 15
7 +9 = 16
8 +4 = 12
8 +5 = 13
8 +6 = 14
8 +7 = 15
8 +9 = 17
9 +3 = 12
9 4 = 13
9 +5 = 14
9 +6 = 15
9 7 = 16
9 8 = 17

Для отправки решений необходимо выполнить вход.

www.contester.ru