409523: GYM103624 B Balanced Cannons
Description
For purposes of self-defense and of course raiding other ships, cannons on board are essential to any pirate fleet. Jeanne de Clisson is taking inventory of the cannons on her flagship My Revenge, noting how many are currently lined up on both the port and starboard sides. However, cannons can be heavy enough to weigh down a ship, and if balanced incorrectly, they can potentially tip it over in the water! Help Jeanne analyze the layout of cannons on her ship and determine if they are in balance.
InputThe first line of input contains two space-separated integers $$$W$$$ ($$$1 \leq W \leq 1000$$$), denoting the weight of each cannon, and $$$D$$$ ($$$1 \leq D \leq 10^9$$$), denoting the maximum weight difference allowed between the two sides of the ship in order for it to be considered balanced.
Then the second line of input contains two integers $$$C_p$$$ and $$$C_s$$$ ($$$1 \leq C_p, C_s \leq 10^6$$$), denoting the number of cannons currently lined on the port and starboard sides of the ship respectively.
OutputIf the port and starboard sides of the ship are already balanced, print In balance. If they are not in balance but cannons on either side could be moved across to produce a balanced configuration, print Move cannons. Otherwise, print Impossible.
ExamplesInput6 6 1 6Output
Move cannonsInput
4 4 7 8Output
In balance