**1 人解决**，1 人已尝试。

**1 份提交通过**，共有 4 份提交。

**9.3** EMB 奖励。

**单点时限: **5.0 sec

**内存限制: **256 MB

Wind Corridor is a covered passageway where strong wind is always blowing. It is a long corridor of width , and there are several pillars in it. Each pillar is a right prism and its face is a polygon (not necessarily convex).

In this problem, we consider two-dimensional space where the positive -axis points the east and the positive -axis points the north. The passageway spans from the south to the north, and its length is infinity. Specifically, it covers the area . The outside of the passageway is filled with walls. Each pillar is expressed as a polygon, and all the pillars are located within the corridor without conflicting or touching each other.

Wind blows from the south side of the corridor to the north. For each second, unit volume of air can be flowed at most if the minimum width of the path of the wind is . Note that the path may fork and merge, but never overlaps with pillars and walls.

Your task in this problem is to write a program that calculates the maximum amount of air that can be flowed through the corridor per second.

The first line of the input contains two integers and . is the width of the corridor, and is the number of pillars. and satisfy the following condition: and .

Then, specifications of each pillar follow. Each specification starts with a line that contains a single integer , which is the number of the vertices of a polygon (). The following lines describe the shape of the polygon. The -th line () contains two integers and that denote the coordinate of the -th vertex ().

Your program should print a line that contains the maximum amount of air flow per second, in unit volume. The output may contain arbitrary number of digits after the decimal point, but the absolute error must not exceed .

Input

5 2 4 1 1 1 2 2 2 2 1 4 3 3 3 4 4 4 4 3

Output

3.41421356

**1 人解决**，1 人已尝试。

**1 份提交通过**，共有 4 份提交。

**9.3** EMB 奖励。

题目标签