#HK3480. 「ROIR 2021 Day 2」A+B
「ROIR 2021 Day 2」A+B
Description
Translated from ROIR 2021 Day2 T4 A+B on this website.
There are three integers with length which may consist of prefix zeros with the following layout that has three lines and columns.
a
b
c
Your task is to find the number of ways arranging the columns in which the three integers horizontally read satisfies that and that all those numbers have no prefix zeros.
Since it is possible that large amount of solutions exist, it is only required to output the number of solutions .
Input Format
Three lines with each line consists of an integer of length .
Output Format
The number of solutions .
123
123
246
6
All ways of arranging the columns satisfy the conditions.
01
02
03
1
Only satisfies the condition since consists of prefix zeros.
01211
12099
23300
4
It is obvious that both and satisfy the condition but, for each of these solutions, there are two ways of obtaining them. Thus the total number of ways are .
121
214
999
0
Constraints
For all test data, it is guaranteed that .
| Subtask # | Additional Constraints | Score |
|---|---|---|
| , with no in numbers | ||
| , with no in numbers | ||
| There are no in numbers | ||
| No Additional Constraints |