Logo
(追記) (追記ここまで)

18520번 - Battle Royale 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB111100.000%

문제

Have you ever played Battle Royale games? In this kind of games, players are left alone and empty in a large area, and they must collect weapons, ammo, medkits and armor in order to kill each other. The game ends when only one player remains, this player is declared the winner.

To provoke players to fight each other, the safe zone is introduced. Players who are outside the safe zone are getting damage. Safe zone is always getting smaller and smaller, until it becomes a single point, so sooner or later each player has to make a choice: get inside a safe zone and fight other players or stay outside, lose hit points and eventually die.

In one-dimensional world, there is a famous Battle Royale game: BattleUnknown’s Playergrounds. The game area is a segment [L, R]. Initially, the safe zone is the whole segment [L, R], and in the end of the game it will narrow to a single point M (L ≤ M ≤ R), where M is chosen equiprobably on the segment [L, R]. The safe zone narrows in such a way that (M−L)/(R−M) = const, and each second its length decreases by 1.

Today we got a match between n extremely passive players: the i-th of them is hiding in the house with the coordinate xi and is not going to move. Imagine it, they better die outside the safe zone than move out of their houses! Their plan is to outlive all others using the medkits they have collected: the i-th player can stay alive for ai seconds outside the safe zone.

For each player, determine the probability that this player wins the game.

입력

The first line contains three integers n, L and R: the number of players and the endpoints of the game segment (1 ≤ n ≤ 105, −106 ≤ L < R ≤ 106).

The next line contains n integers xi: coordinates of the houses where players hide (L < xi < R). They are all different and sorted in ascending order.

The next line contains n integers ai: the time i-th player can stay alive outside the safe zone (0 ≤ ai ≤ 106).

출력

Output n lines. The i-th line should contain a single real number: the probability that the i-th player wins the game. The absolute error of each number should not exceed 10−9.

제한

예제 입력 1

2 -5 5
-1 1
3 5

예제 출력 1

0.438447187191170
0.561552812808830

예제 입력 2

2 0 10
5 7
5 2

예제 출력 2

1.000000000000000
0.000000000000000

예제 입력 3

3 0 10
3 4 7
3 4 8

예제 출력 3

0.109584240176570
0.121686455414586
0.768729304408844

힌트

출처

Camp > Petrozavodsk Programming Camp > Winter 2019 > Day 4: Yandex Cup G번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /