Score : $400$ points
Iroha is into a game where you keep pets.
Iroha's pet is Takahashi. Initially, Takahashi's STR and EXP are $X$ and $0$, respectively. These parameters increase in the following two kinds of training:
Takahashi evolves when his STR becomes $Y$ or greater, but Iroha thinks that makes him less cute.
Find the maximum possible EXP of Takahashi when he is trained without letting him evolve.
Input is given from Standard Input in the following format:
$X$ $Y$ $A$ $B$
Print the maximum possible EXP of Takahashi under the given situation.
4 20 2 10
2
Initially, Takahashi's STR is $4$. We can make his EXP $2$ in the following course of training:
On the other hand, there is no way to train him so that his EXP becomes greater than $2$.
1 1000000000000000000 10 1000000000
1000000007
Watch out for overflows.