Linear Expression
Time limit1sMemory limit1024 MB
Given integers A and B, the task prints the linear expression Ax+B in standard form, dropping zero terms and coefficients of 1.
- Level
Easy1 of 10
- Topics
- Implementation, Math
- Solved
- No attempts yet
Problem
Mathematics has standard forms for expression types that appear often. For example, a polynomial in one variable is written as , where each is either a plus or a minus sign. The terms are ordered by decreasing power of the variable, and unnecessary terms, coefficients, and operator signs are left out. Write a program that takes two integers and and prints the standard form of the linear expression .
Input
The only line contains two integers and (, ).
Output
Print the standard form of on a single line without spaces.