eolymp
bolt
Спробуйте наш новий інтерфейс для відправки розв'язків
Задачі

A Famous Equation

A Famous Equation

Mr. B writes an addition equation such as \textbf{123+321=444} on the blackboard after class. Mr. G removes some of the digits and makes it look like "\textbf{1?3+??1=44?}". Here "\textbf{?}" denotes removed digits. After Mr. B realizes some digits are missing, he wants to recover them. Unfortunately, there may be more than one way to complete the equation. For example "\textbf{1?3+??1=44?}" can be completed to "\textbf{123+321=444}", "\textbf{143+301=444}" and many other possible solutions. Your job is to determine the number of different possible solutions. \InputFile Each test case describes a single line with an equation like \textbf{a+b=c} which contains exactly one plus sign "\textbf{+}" and one equal sign "\textbf{=}" with some question mark "\textbf{?}" represent missing digits. You may assume \textbf{a}, \textbf{b} and \textbf{c} are non-negative integers, and the length of each number is no more than \textbf{9}. In the other words, the equation will contain three integers less than \textbf{1000000000}. \OutputFile For each test case, display a single line with its case number and the number of possible solutions to recover the equation. \Note There are three solutions for the first case: \textbf{7+10=17}, \textbf{7+11=18}, \textbf{7+12=19} There is only one solution for the second case: \textbf{11+11=22} Note that \textbf{01+21=22} is not a valid solution because extra leading zeros are not allowed.
Ліміт часу 1 секунда
Ліміт використання пам'яті 32 MiB
Вхідні дані #1
7+1?=1?
?1+?1=22
Вихідні дані #1
Case 1: 3
Case 2: 1
Джерело ACM ICPC Fudan Local Programming Contest 2012