# Framing Pictures solution codeforces

Life has been discovered on Venus! What is more, the life forms appear to be convex polygons. An international consortium is designing a probe to send to Venus to take pictures, but they need to estimate the bandwidth needed to send back pictures.

## Framing Pictures solution codeforces

When the probe takes a picture of a life form and wishes to send it back to Earth, the bandwidth required is proportional to the area of the bounding box (in other words, the smallest axis-aligned rectangle that contains the life-form). The shape and size of the life forms are known, but the orientation relative to the camera is random. You must thus determine the expected (average) area of the bounding box across all orientations.

### Input Framing Pictures solution codeforces

The input describes the shape of a life form as a convex polygon in two dimensions.

The first line of input contains an integer nn (3≤n≤2000003≤n≤200000) — the number of vertices. The remaining nn lines each contain two integers xx and yy (−109≤x,y≤109−109≤x,y≤109) — the coordinates of a vertex. The vertices are given in counterclockwise order, and no three vertices lie on a straight line.

## Output Framing Pictures solution codeforces

Output a single line containing the expected area of the bounding box of the polygon. Your answer should have an absolute or relative error of at most 10−610−6.

## Copy Framing Pictures solution codeforces

4 0 0 10 0 10 10 0 10

### Copy Framing Pictures solution codeforces

163.661977237

### Copy Framing Pictures solution codeforces

5 0 0 10 0 15 8 5 20 -5 7

### Copy Framing Pictures solution codeforces

365.666028588

The pictures show example life forms and various camera orientations.