Polygon Discovery
시간 제한4초메모리 제한2048 MB
원점을 내부에 포함하는 미지의 볼록 정수 다각형에 대해, 주어진 직선이 다각형과 만나는 횟수를 묻는 질의만으로 넓이를 구한다.
문제
You are a member of the research team CPCI (Convex Polygon Computational Investigation), tasked with uncovering the properties of an unknown simple polygon located on a two-dimensional coordinate plane. The exact coordinates of the polygon are unknown, but you can use a special equipment that allows you to query the number of intersections between a given query line and .
The polygon is known to be a convex polygon, meaning every line segment between two points inside the polygon is fully contained within its interior. Additionally, is non-degenerate, ensuring that its area is strictly greater than zero. The polygon also contains the origin strictly within its interior. All vertices of have integer coordinates, with each coordinate lying within the range inclusive.
Write a program to compute the area of the polygon by invoking a series of queries.