Files
PAT/html/a1009.html
T

23 lines
1.1 KiB
HTML

<!DOCTYPE html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<h1>1009. Product of Polynomials (25)</h1>
<div id="problemContent">
<p>This time, you are supposed to find A*B where A and B are two polynomials.</p>
<p><b>
Input Specification:
</b></p>
<p>Each input file contains one test case. Each case occupies 2 lines, and each line contains the information of a polynomial:
K N1 a<sub>N1</sub> N2 a<sub>N2</sub> ... NK a<sub>NK</sub>, where K is the number of nonzero terms in the polynomial, Ni and a<sub>Ni</sub> (i=1, 2, ..., K) are the exponents and coefficients, respectively. It is given that 1 &lt;= K &lt;= 10, 0 &lt;= NK &lt; ... &lt; N2 &lt; N1 &lt;=1000.
<p>
<p><b>
Output Specification:
</b></p>
<p>For each test case you should output the product of A and B in one line, with the same format as the input. Notice that there must be NO extra space at the end of each line. Please be accurate up to 1 decimal place. </p>
<b>Sample Input</b><pre>
2 1 2.4 0 3.2
2 2 1.5 1 0.5
</pre>
<b>Sample Output</b><pre>
3 3 3.6 2 6.0 1 1.6
</pre>
</p></p></div>