A – Not
Spoiler
Should be easy as long as you know the basics of your chosen programming language. Can be computed with an if/else statement, the ternary operator (ans = x == 1 ? 0 : 1
), or the xor operator (ans = x ^ 1
)
B – Product Max
Spoiler
Answer is one of: $$$a \cdot c, a \cdot d, b \cdot c, b \cdot d$$$; find the maximum of these and print it.
Proof by exchange argument: No matter what you pick $$$x$$$ to be, you can improve the product by either maximizing or minimizing $$$y$$$, based on the sign of $$$x$$$. Same argument applies when $$$x$$$ and $$$y$$$ are swapped.