Under construction

Still being built. Things may change

Cruel games

Time limit5sMemory limit1024 MB

Summary
Alice picks a point off every obstacle line so that the worst-case number of segments blocking her view of Bob, over all his positions, is minimized.
Level

Medium7 of 10

Topics
Geometry, Brute force, Implementation
Solved
No attempts yet

Statement

Alice and Bob play a cruel game on a plane.

There are nn obstacles on the plane, and each one is a line segment. First, Alice picks a point on the plane that does not lie on any line containing an obstacle, and stands there. Then Bob picks a point and stands there. After that, Alice shoots at Bob.

Bob wants to be safe, so he picks a point where as many obstacles as possible lie between him and Alice. If an endpoint of an obstacle lies on the segment connecting Alice and Bob, Bob is considered hidden behind that obstacle.

Alice wants to hit Bob, so she picks a point where as few obstacles as possible lie between her and Bob. Help her do that.

Input

The first line contains nn (1≤n≤81 \le n \le 8), the number of obstacles. Each of the next nn lines contains four integers x_1,y_1,x_2,y_2x\_1, y\_1, x\_2, y\_2, the coordinates of the endpoints of an obstacle. No two obstacles share a point. All coordinates have absolute value at most 100.

Output

On the first line, print kk, the minimum number of obstacles that can end up between Alice and Bob when both play optimally.

On the second line, print the point where Alice should stand. The point must not lie on any line containing an obstacle.

Examples1

  1. Example 1

    Input
    2
    0 0 2 0
    0 2 2 2
    
    Expected output
    1
    1.000000000000000 1.000000000000000