Under construction

Still being built. Things may change

Playing the Slots

Interview

Time limit1sMemory limit1024 MB

Summary
Given a convex polygon, find the smallest slot width through which the polygon fits after any rotation.
Level

Medium4 of 10

Topics
Geometry, Brute force
Solved
No attempts yet

Problem

The small nation of Erratica prides itself on defying conventions established by the more "boring" countries around the world. One of their more obvious distinctions lies in the design of their coinage. Believing that a person should be easily able to identify the value of a coin in a pocket or change purse by touch alone, Erratica designs its coins as polygons. For stability, the coins are convex: there are no notches cut into them. But the overall shapes themselves can be quite irregular.

Erratica Vending, the only manufacturer of vending machines in the nation, has been sent the design for a new coin to be issued. Their machines are designed so that coins enter through a slot into a channel shaped as a rectangular prism, with the slot being an open face of the prism. The channel is narrow because the coins are thin, but long enough to contain the entire coin. From the outside of the machine, the slot appears as a rectangular hole.

The company wants to know the smallest slot size it will need so that the new coin can be slipped, after some rotation, into the slot.

Input

Input begins with a line containing NN, the number of sides of the polygonal coin. 3≤N≤203 \leq N \leq 20.

This is followed by NN lines, each containing two real numbers xx and yy, the coordinates of a vertex of the polygon. 0.0≤x,y≤100.00.0 \leq x, y \leq 100.0

All NN vertices will be distinct, and the vertices will be presented in an order proceeding clockwise around the perimeter of the coin.

Output

Print a single line with a real number, to two decimal places, denoting the minimum slot size that allows the coin to pass through. Answers within ±0.01\pm 0.01 of the judges' answer will be accepted.

Examples2

  1. Example 1

    Input
    3
    0 0
    0.71 3.54
    4.21 4.21
    
    Expected output
    2.00
    
  2. Example 2

    Input
    6
    10 12.5
    10 17.5
    15 20
    20 17.5
    20 12.5
    15 10
    
    Expected output
    8.94