In high school mathematics, there are lots of situations to deal with the multiplication of polynomials, and sometimes it would be a little bit annoying. Now, since you have learnt programming, please write a program that helps you to make such annoying things easy.
First line of input are two numbers $n \ m$, which represent the length of following polynomials. ($1 \leq n, m \leq 10$)
Following are two lines of numbers $a_0, a_1 \dots a_{n-1}$ and $b_0, b_1, \dots b_{m-1}$, which represent the coeffecients (where $a_i, b_i$ are the coeffecient of term $x^ \wedge i$, and $-100 \leq a_i, b_i \leq 100$) in the polynomials respectively.
A single line $c_0 \ c_1x \ c_2x ^ \wedge 2 \ \dots$ which represents the result of multiplication of given polynomials in ascending order.
Notice that you do not need to print out term $x^ \wedge i$ if $c_i = 0$, and there is a single space between each term.
No. | Testdata Range | Score |
---|---|---|
1 | 0~6 | 20 |
No. | Time Limit (ms) | Memory Limit (KiB) | Output Limit (KiB) | Subtasks |
---|---|---|---|---|
0 | 1000 | 65536 | 65536 | |
1 | 1000 | 65536 | 65536 | |
2 | 1000 | 65536 | 65536 | |
3 | 1000 | 65536 | 65536 | |
4 | 1000 | 65536 | 65536 | |
5 | 1000 | 65536 | 65536 | |
6 | 1000 | 65536 | 65536 |