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

11620번 - Hovering Hornet 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB99494257.534%

문제

You have managed to trap a hornet inside a box lying on the top of your dining table. Unfortunately, your playing dice is also trapped inside – you cannot retrieve it and continue your game of Monopoly without risking the hornet’s wrath. Instead, you pass your time calculating the expected number of spots on the dice visible to the hornet.

The hornet, the dice and the box are located in the standard three-dimensional coordinate system with the x coordinate growing eastwards, the y coordinate growing northwards and the z coordinate growing upwards. The surface of the table corresponds to the x-y plane.

Perspective and the birds-eye view of the second example input

The dice is a 1 × 1 × 1 cube, resting on the table with the center of the bottom side exactly in the origin. Hence, the coordinates of its two opposite corners are (−0.5, −0.5, 0) and (0.5, 0.5, 1). The top side of the dice has 5 spots, the south side 1 spot, the east side 3 spots, the north side 6 spots, the west side 4 spots and the (invisible and irrelevant) bottom side 2 spots.

The box is a 5 × 5 × 5 cube also resting on the table with the dice in its interior. The box is specified by giving the coordinates of its bottom side – a 5 × 5 square.

Assume the hornet is hovering at a uniformly random point in the (continuous) space inside the box not occupied by the dice. Calculate the expected number of spots visible by the hornet. The dice is opaque and, hence, the hornet sees a spot only if the segment connecting the center of the spot and the location of the hornet does not intersect the interior of the dice.

입력

Input consists of 4 lines. The k-th line contains two floating-point numbers xk and yk (−5 ≤ xk, yk ≤ 5) – coordinates of the k-th corner of the bottom side of the box in the x-y plane. The coordinates are given in the counterclockwise direction and they describe a square with the side length of exactly 5.

The box fully contains the dice. The surfaces of the box and the dice do not intersect or touch except along the bottom sides.

출력

Output a single floating point number – the expected number of spots visible. The solution will be accepted if the absolute or the relative difference from the judges solution is less than 10−6.

제한

예제 입력 1

-2.5 -1.5
2.5 -1.5
2.5 3.5
-2.5 3.5

예제 출력 1

10.6854838710

예제 입력 2

3 0
0 4
-4 1
-1 -3

예제 출력 2

10.1226478495

힌트

출처

ICPC > Regionals > Europe > Central European Regional Contest > CERC 2015 H번

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

출처

대학교 대회

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

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