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

18201번 - Crazed Boar 스페셜 저지다국어

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

문제

A crazed boar has become lost in the forest! In its madness, it will charge in a random direction at blazing speed, until it has traveled a distance d, or until it hits a tree (in which case the boar will become dazed and end its charge), whichever comes first. Given the layout of trees around the boar, what is the probability the boar completes its wild charge without hitting a tree?

We will model the forest as the xy plane, with the boar a disk of radius b that begins centered at the origin (0, 0). We will also represent the trees as disks, with varying radii ri and centers (xi, yi). The boar charges by choosing a direction uniformly at random, and then translating in that direction for a distance d. The boar hits a tree and becomes dazed if, at any point during its charge, the boar’s body has nonzero area of overlap with any tree.

입력

The first line of input contains a single integer n (0 ≤ n ≤ 10 000), the number of trees in the forest. n lines follow, each of which contain three integers xi, yi, and ri, denoting the position and radius of the ith tree. These inputs satisfy −106 ≤ xi, yi ≤ 106 and 0 < ri ≤ 106. The final line of input contains two integer b and d, the radius of the boar (0 < b ≤ 106) and the distance that the boar will charge (0 ≤ d ≤ 106). You may assume that no tree overlaps with or touches the boar at the start of its charge (but trees might overlap or touch each other).

출력

Print a single real number: the probability that the boar completes its charge without hitting any tree. Your answer will be considered correct if it has absolute or relative error at most 10−6.

제한

예제 입력 1

1
3 0 1
1 4

예제 출력 1

0.76772047

예제 입력 2

4
6 0 3
0 6 3
-6 0 3
0 -6 3
1 3

예제 출력 2

0.19253205

힌트

출처

ICPC > Regionals > North America > Mid-Central Regional > 2019 Mid-Central Regional Programming Contest D번

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

출처

대학교 대회

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

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