Problem D
Code to Save Lives
Daenerys and her fellow friends decided to go on a magical adventure to find the mystical scientist to cure her village of disease. On her adventure she faces the winter and desert until she finally found the genius scientist, and while Daenerys explained her dire situation to the scientist, the scientist agreed to save her village under one condition.
She must prove her village is worthy of saving by solving the following problem: given that numbers are observing numerical distancing, which means they each need a space in between each digit, provide the sum of two numerically distanced numbers. For example, the numerically distanced numbers $3\ 4\ 5$ and $5\ 6\ 7$ sum to $9\ 1\ 2$.
Input
The input consists of $3$ different segments:
-
The first line will have the number of test cases $t$, where $1 \leq t \leq 10$.
-
The first line of each case will contain the first positive numerically distanced whole number, which will have the number’s digits, $0$ – $9$, be space-separated. The amount of digits in this line is $m$, where $1 \leq m \leq 9$.
-
The second line of each case will contain the second positive numerically distanced whole number, which will have the number’s digits, $0$ – $9$, be space-separated. The amount of digits in this line is $n$, where $1 \leq n \leq 9$.
Output
Output the sum of the numerically distanced numbers for each of the test cases on one line each.
Sample Input 1 | Sample Output 1 |
---|---|
2 3 4 5 5 6 7 6 1 3 2 5 |
9 1 2 3 8 6 |
Sample Input 2 | Sample Output 2 |
---|---|
1 1 4 8 0 5 4 3 8 4 |
1 9 1 8 9 |
Sample Input 3 | Sample Output 3 |
---|---|
3 4 4 5 7 6 6 2 7 8 2 0 2 3 |
4 9 7 0 3 8 4 3 |