Sign of Operation
Time limit1sMemory limit128 MB
Choose the operator among +, -, and * that gives the largest value for a and b, and print the expression or NIE on a tie.
- Level
Easy1 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Problem
You are given two integers and . Insert one of the operators +, -, or * between them so that the value of the resulting expression is as large as possible. If that largest value can be reached by more than one operator, print NIE instead.
Input
A single line contains two integers and ().
Output
Print the expression that yields the largest value, in the form a<operator>b=result, on one line. Wrap a negative operand in parentheses (for example (-5)). Do not put the result in parentheses. If more than one operator produces the largest value, print NIE instead.