Description
Write a program to input pairs of polynomials and output:

Output them in canonical form. Then compute and output:

Their sum (add them)

Their difference (subtract them)

Their product (multiply them).
Question: What do we mean by “canonical form”?
Answer: This is a representation where

The polynomial is written from the highest powers to the lowest, and

All terms with the same power are “consolidated.” If the consolidation leads to a zero coefficient, do not display that term.
Example: If the input were
1+5x+20x^39x^22x+x^22x^3+x^9,
You would change it to:
x^9+18x^3–8x^2+3x1
The input:
Read the input from a file called input.txt in the same directory as your program.
Each line (terminated by a newline character) in the file will represent a polynomial. The line will contain a list of integers, which when taken in pairs, will represents the coefficient and exponent of each of the terms in the polynomial.
Processing and output:
You will process each pair of lines, representing two polynomials and will:

Output them first as they appear in the file and then in canonical form. Then compute and output, all in canonical form:

Their sum (add them)

Their difference (subtract them)

Their product (multiply them).
Output them to a file in your program’s directory called output.txt