1009 Product of Polynomials

1009 Product of Polynomials (25)(25 分)

This time, you are supposed to find A*B where A and B are two

polynomials.

Input Specification:

Each input file contains one test case. Each case occupies 2 lines, and

each line contains the information of a polynomial: K N1 a~N1~ N2 a~N2~

... NK a~NK~, where K is the number of nonzero terms in the polynomial,

Ni and a~Ni~ (i=1, 2, ..., K) are the exponents and coefficients,

respectively. It is given that 1 <= K <= 10, 0 <= NK < ...

< N2 < N1 <=1000.

Output Specification:

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.

Sample Input

2 1 2.4 0 3.2

2 2 1.5 1 0.5

Sample Output

3 3 3.6 2 6.0 1 1.6



©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 年少的时候,大人教育我们,不要辜负父母的期望,要好好学习,将来要报答父母。年少懵懂,大多数人还不明白为什么读书,往...
    菟米阅读 483评论 1 1
  • 早上五点多就醒了,然后回了Y的短信。突然不想让自己再睡了,其实是心里有事,总归有点伤感,责怪自己,为什么不会伪装一...
    行走的大海酱阅读 202评论 0 0
  • 喜欢写作,却没找到适合自已吐露心声的平台,那就到处游走吧。开始的时候,在公司平台写一些诗歌之内的题材,发...
    追风_defb书写人生阅读 287评论 23 30
  • 面目全非 又行色匆匆 回去了 又来来回回 我拿着红包 身体蜷缩 弯在路上 伴着星光入梦 糊涂 触目 忽然间你走过来...
    留子尧阅读 300评论 2 7
  • 跟同学说要写一篇文章《闽南式相亲》。拖了两天。 闽南的相亲模式是:媒人带着男方,男方带着家里的亲戚、朋友到...
    樱雪花开阅读 1,443评论 1 6