You are playing a strategy game . There is a battle happening right now between your soldiers and your biggest opponent. Both of you are losing forces and you want to be sure you’ll win if everything continues at this rate, and plan the strategy accordingly.
You see that you lose approximately
xsoldiers in a minute, while your opponent loses
ysoldiers in the same time frame. You initially have
soldiers, while your opponent has
soldiers on the battlefield. The battle continues until any of the parties lose all their soldiers.
The first line of the input contains the number of your initial soldiers
, followed by the rate (
x) at which you lose soldiers. The third line contains the initial number of soldiers of the opponent
, followed by the rate at which they lose soldiers
Your program should print
You will winif you are expected to win if things continue in the same manner, and it should print
There is a danger of losingotherwise.
100 5 200 30
You will win
149 30 21 5
There is a danger of losing
- It will take 20 minutes to lose all your soldiers, while it will take 7 minutes for your opponent.
- It will take both of you 5 minutes to lose all your soldiers.
Time limit: 1 seconds
Memory limit: 512 MB
Output limit: 1 MB