{"raw_statement":[{"iden":"problem statement","content":"We have a $N$\\-face die (singular of dice) that shows integers from $1$ through $N$ with equal probability.  \nBelow, the die is said to be showing an integer $X$ when it is placed so that the top face is the face with the integer $X$.  \nInitially, the die shows the integer $S$.\nYou can do the following two operations on this die any number (possibly zero) of times in any order.\n\n*   Pay $A$ yen (the Japanese currency) to \"increase\" the value shown by the die by $1$, that is, reposition it to show $X+1$ when it currently shows $X$. This operation cannot be done when the die shows $N$.\n*   Pay $B$ yen to recast the die, after which it will show an integer between $1$ and $N$ with equal probability.\n\nConsider making the die show $T$ from the initial state where it shows $S$.  \nPrint the minimum expected value of the cost required to do so when the optimal strategy is used to minimize this expected value."},{"iden":"constraints","content":"*   $1 \\leq N \\leq 10^9$\n*   $1 \\leq S, T \\leq N$\n*   $1 \\leq A, B \\leq 10^9$\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$ $S$ $T$ $A$ $B$"},{"iden":"sample input 1","content":"5 2 4 10 4"},{"iden":"sample output 1","content":"15.0000000000000000\n\nWhen the optimal strategy is used to minimize the expected cost, it will be $15$ yen."},{"iden":"sample input 2","content":"10 6 6 1 2"},{"iden":"sample output 2","content":"0.0000000000000000\n\nThe die already shows $T$ in the initial state, which means no operation is needed."},{"iden":"sample input 3","content":"1000000000 1000000000 1 1000000000 1000000000"},{"iden":"sample output 3","content":"1000000000000000000.0000000000000000\n\nYour output will be considered correct when its absolute or relative error is at most $10^{-5}$."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}