eolymp
bolt
Try our new interface for solving problems
Problems

School algebra

School algebra

Trinomial \textbf{ax + by + c} of two variables \textbf{x} and \textbf{y} are uniquely determined by the constant term \textbf{c} and the coefficients \textbf{a} and \textbf{b}. Write a program that, given \textbf{a}, \textbf{b} and \textbf{c} displays the corresponding trinomial recorded using algebraic arrangements: \begin{itemize} \item coefficient of the term containing the variable is omitted if it is equal to one unit; \item term, the coefficient which is equal to zero, is omitted; \item "+" sign is omitted if it is preceded by a negative coefficient; \item "+" sign is omitted if it is at the beginning of (the so-called unary plus); \item multiplication sign between the coefficient and the variable is omitted. \end{itemize} At the same time it is not allowed to swap terms. \InputFile The input file contains three integers \textbf{a}, \textbf{b} and \textbf{c} (\textbf{-9} ≤ \textbf{a}, \textbf{b}, \textbf{c} ≤ \textbf{9}). \OutputFile Print a string containing the trinomial, written according to these rules.
Time limit 1 second
Memory limit 64 MiB
Input example #1
1 2 3
Output example #1
x+2y+3
Source Stage II Ukrainian School Olympiad 2011-2012, Berdichev