시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 (추가 시간 없음) 256 MB31151463.636%

문제

You are given $n$ points on a plane. The i-th of them is activated with probability $p_i$, provided as part of the input. Find the expected circumference of the convex hull of all activated points.

입력

The first line contains the number of points $n$ and the number $p^∗$. All points are activated with the probability $p_i = p^∗$, except for the first three, which are always activated ($p_1 = p_2 = p_3 = 1$); this way, the definition of the convex hull circumference is always sound. This is followed by $n$ lines, each containing space-separated coordinates of the $i$-th point, $x_i$, $y_i$.

출력

Print out a single number — the expected circumference of the convex hull. Your result should differ by less than $0.001$ from the reference solution to be considered correct.

제한

  • $3 ≤ n ≤ 1000$; $0 ≤ p^∗ ≤ 1$
  • $0 ≤ x_i , y_i ≤ 10\,000$; $x_i , y_i ∈ Z$
  • No three points are colinear. No two points share an $x$ or $y$ coordinate.

예제 입력 1

4 0.281250
6 6
5 8
8 3
7 10

예제 출력 1

12.816849

예제 입력 2

5 0.561523
2 11
7 8
13 10
9 9
13 3

예제 출력 2

27.943471