#P3558. Easy Geometry

    ID: 2442 远端评测题 5000ms 64MiB 尝试: 0 已通过: 0 难度: (无) 上传者: 标签>2010 ACM-ICPC Multi-University Training Contest(12)——Host by WHU

Easy Geometry

Problem Description

There are a set of points in the plane. Dumbear will choose some of them and find the convex hull of the chosen points. For each point, we know that probability that Dumbear will choose it. We want to know the expected number of vertexes the convex hull had.
You can assume that any three points are not in the same line. If the number of the chosen points is smaller than three, we think all the chosen points are vertexes of the convex hull.

Input

There are several test cases in the input.
The first line of each test case contains an integer n (1<=n<=1000). n lines follow, each line contains three integers x, y and p (1<=x, y<= 100000, 0 <= p < 100) indicating a point at (x, y) and Dumbear will choose it with probability p%.
The input terminates by end of file marker.

Output

For each test case, output the answer rounded to 2 digits after the decimal point.

1 1 1 50 3 1 1 99 1 2 99 2 3 0 4 1 1 50 5 1 50 1 5 50 2 2 50
0.50 1.98 1.94

Author

hanshuai@WHU