$25
CMPUT 275 - Tangible Computing II
Morning Problem: Check Digits
Description I have two really big, non-negative numbers - one is m digits long and the
other is n digits long. Can you help me compute their product?
Input
The first line will consist of two integers 1 ≤ m, n ≤ 100. The next line will consist of
m space-separated digits, denoting the first number. The final line will consist of n spaceseparated digits, denoting the second number.
Output
You must output a single line consisting of m + n space-separated digits, denoting the product of the two numbers. Always output this many digits, even if there are leading 0s.
Sample Input 1
3 1
9 0 0
9
Sample Output 1
8 1 0 0
Explanation: 900 × 9 = 8100
Sample Input 2
2 2
1 1
1 1
Sample Output 2
0 1 2 1
Explanation: 11 × 11 = 121
Sample Input 3
4 7
4 0 9 6
1 0 4 8 5 7 6
Sample Output 3
0 4 2 9 4 9 6 7 2 9 6
Explanation: 4, 096 × 1, 048, 576 = 4, 294, 967, 296