PAT 1002 两多项式相加
1002 A+B for Polynomials This time, you are supposed to find A+B where A and B are two polynomials. 这次,你需要找到两个多项式A和B的和。 Input Specification: Each input file contains one test case. Each case occupies 2 lines, and each line contains the information of a polynomial: K N_1 a_{N1} N_2 a_{N2} ... N_{K} a_{NK} where K is the number of nonzero terms in the polynomial, N_{i} and a_{Ki} (i=1,2,⋯,K) are the exponents and coefficients, respectively. It is given that 1≤K≤10 , 0≤N_{K}<⋯<N_{2}<N_{1}....