P27081 [AtCoder] Enclosure
NOI
题目描述

Problem Description

Among the lattice points in a 2-dimensional plane, $N$ lattice points are colored. By selecting some of these colored lattice points, a simple polygon with these points as vertices can be formed. Find the area of the simple polygon that contains the origin within its interior and has the smallest area.

A simple polygon is defined as a polygon without self-intersections.

Input Format

The input is given from the standard input in the following format:

$ N $ $ X_1 $ $ Y_1 $ $ X_2 $ $ Y_2 $ : $ X_N $ $ Y_N $

  • The first line contains an integer $N(1\ \leq\ N\ \leq\ 200)$ representing the number of lattice points.
  • The $ 1+i $ line contains the coordinates $(X_i,\ Y_i)$ of the $ i $th lattice point.
  • The given lattice points satisfy the following constraints:
  • $-100000\ \leq\ X_i,\ Y_i\ \leq\ 100000$
  • $(X_i,\ Y_i)\ \neq\ (X_j,\ Y_j)\ (i\ \neq\ j)$
  • $(X_i,\ Y_i)\ \neq\ (0,\ 0)$

Output Format

  • If no simple polygon containing the origin within its interior exists, output only Impossible in one line.
  • If such a simple polygon exists, output Possible in the first line, and the minimum area in the second line.
  • Do not forget to add a newline. The area should be considered correct if the absolute or relative error from the expected answer is within $ 10^{-8} $.

Sample Input and Output

Sample Input #1

3
-1 -1
1 -1
0 2

Sample Output #1

Possible
3.0000000000

Sample Input #2

4
-1 -1
1 -1
1 1
-1 1

Sample Output #2

Possible
4.0000000000

Sample Input #3

3
-1 -1
1 -1
1 1

Sample Output #3

Impossible

Notes/Hints

Sample Explanation 1

The triangle formed by connecting the 1st, 2nd, and 3rd points is the simple polygon with the smallest area that contains the origin within its interior.

Sample Explanation 2

The quadrilateral formed by connecting the 1st, 2nd, 3rd, and 4th points is the simple polygon with the smallest area that contains the origin within its interior. Note that depending on the order of connection, it may not form a simple polygon.

Sample Explanation 3

The triangle formed by connecting the 1st, 2nd, and 3rd points contains the origin on its boundary but not within its interior, thus does not satisfy the condition. Therefore, no simple polygon containing the origin within its interior exists.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
3 -1 -1 1 -1 0 2
样例输出
Possible 3.0000000000