F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Go to school

Time 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
2 2 6 1 2 2 4 2 3
 

Sample Output
2.851852 3.129630
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-04-26 14:57:55, Gzip enabled