CF163C.Conveyor

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Anton came to a chocolate factory. There he found a working conveyor and decided to run on it from the beginning to the end.

The conveyor is a looped belt with a total length of 2l2l meters, of which ll meters are located on the surface and are arranged in a straight line. The part of the belt which turns at any moment (the part which emerges from under the floor to the surface and returns from the surface under the floor) is assumed to be negligibly short.

The belt is moving uniformly at speed v1v_{1} meters per second. Anton will be moving on it in the same direction at the constant speed of v2v_{2} meters per second, so his speed relatively to the floor will be v1+v2v_{1}+v_{2} meters per second. Anton will neither stop nor change the speed or the direction of movement.

Here and there there are chocolates stuck to the belt ( nn chocolates). They move together with the belt, and do not come off it. Anton is keen on the chocolates, but he is more keen to move forward. So he will pick up all the chocolates he will pass by, but nothing more. If a chocolate is at the beginning of the belt at the moment when Anton starts running, he will take it, and if a chocolate is at the end of the belt at the moment when Anton comes off the belt, he will leave it.

The figure shows an example with two chocolates. One is located in the position a1=lda_{1}=l-d , and is now on the top half of the belt, the second one is in the position a2=2lda_{2}=2l-d , and is now on the bottom half of the belt. You are given the positions of the chocolates relative to the initial start position of the belt 0<=a_{1}<a_{2}<...<a_{n}<2l . The positions on the belt from 00 to ll correspond to the top, and from ll to 2l2l — to the the bottom half of the belt (see example). All coordinates are given in meters.

Anton begins to run along the belt at a random moment of time. This means that all possible positions of the belt at the moment he starts running are equiprobable. For each ii from 00 to nn calculate the probability that Anton will pick up exactly ii chocolates.

输入格式

The first line contains space-separated integers nn , ll , v1v_{1} and v2v_{2} ( 1<=n<=1051<=n<=10^{5} , 1<=l,v1,v2<=1091<=l,v_{1},v_{2}<=10^{9} ) — the number of the chocolates, the length of the conveyor's visible part, the conveyor's speed and Anton's speed.

The second line contains a sequence of space-separated integers a1,a2,...,ana_{1},a_{2},...,a_{n} ( 0<=a_{1}<a_{2}<...<a_{n}<2l ) — the coordinates of the chocolates.

输出格式

Print n+1n+1 numbers (one per line): the probabilities that Anton picks up exactly ii chocolates, for each ii from 00 (the first line) to nn (the last line). The answer will be considered correct if each number will have absolute or relative error of at most than 10910^{-9} .

输入输出样例

  • 输入#1

    1 1 1 1
    0
    

    输出#1

    0.75000000000000000000
    0.25000000000000000000
    
  • 输入#2

    2 3 1 2
    2 5
    

    输出#2

    0.33333333333333331000
    0.66666666666666663000
    0.00000000000000000000
    

说明/提示

In the first sample test Anton can pick up a chocolate if by the moment he starts running its coordinate is less than 0.5; but if by the moment the boy starts running the chocolate's coordinate is greater than or equal to 0.5, then Anton won't be able to pick it up. As all positions of the belt are equiprobable, the probability of picking up the chocolate equals , and the probability of not picking it up equals .

首页