|
||||||||||
Go to schoolTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 64 Accepted Submission(s): 29 Special Judge Problem Description Tongjiang wanna go back to UESTC from Xipu. He had arrived Xipu bus station at $(T=0)$.He would like take a bus or walk, for details, it takes $A$ minutes to take a bus while $B$ minutes to walk($A<B$ will be hold).There are $N$ bus lines all can take Tongjiang to UESTC, But as it was getting late,some bus lines may had already stopped running. Properly speaking, the bus line have a probability of $(1-\frac{L_i}{M})$ that it had already stopped running and no more bus will come to Xipu station, and a probability of $(\frac{L_i}{M}$) that there will be a bus come to Xipu station to take Tongjiang to UESTC. And in the second case the bus may arrive at bus station at any time $T$, which holds $(0 \leq T \leq Li)$, with equal probability. Tongjiang is a smart boy, he had $Q$ different strategy to wait bus. Under strategy $i$ He would set a latest time point $T_i$ first. Then he started waiting for bus and take the first bus come to station who can take him to school or when time come to $(T=T_i)$ and still no bus come, he would start walk to school.$\\$ Now, Tongjiang wonders under each strategy, what's the expect time he arrive at school. For all bus line $i$, $( \frac{1}{3} M \leq L_i \leq \frac{2}{3} M )$ For all strategy $i$, $( Min(L_1,L_2...L_N) \leq T_i \leq Max(L_1,L_2...L_N) )$ $(6 \leq M \leq 100000)$ $(1 \leq A,B\leq 100000)$ $(2 \leq N \leq 12)$ $(1 \leq Q \leq 100000 )$ Input First line five positive integer $N,Q,M,A$ and $B$. Second line N positive integer $(L_1,L_2...L_N)$ Then $Q$ lines following,each line contains one integer means a latest time point $T_i$. Output For each strategy,print one line with you answer. Your answer will be considered to be right if $\min{\left\{\left|yourans-stdans\right|, \left|\frac{yourans-stdans}{stdans}\right|\right\}} < 10^{-4}$ $(min(abs(yourans-stdans),abs(\frac{yourans-stdans}{stdans})<1e-4)$. Sample Input
Sample Output
Source | ||||||||||
|