Crane Balancing
Time limit1sMemory limit128 MB
Find the range of extra weight at the first vertex that keeps the polygon balanced on the x-axis.
Problem
A crane cross section is a polygon resting on the -axis. Each unit of area weighs 1 kg.
Extra weight is attached at the first polygon vertex. Find the range of attachable weight (in kg) for which the crane does not topple left or right. Print for range , or for . Print unstable if no weight works.
Input
- (): number of vertices.
- Next lines: . Weight attaches at the first vertex; at least two vertices have .
Output
Stable weight range, or unstable.