A Hole to Catch a Man

How can a manhole be a hole if it is covered? Perhaps, to prove a manhole a hole, most of the manholes of Dhaka are uncovered. So now manhole means a hole to catch a man. Anyway, the new Mayor of Dhaka does not like this definition and he has recently been highly acclaimed by general people for ordering corresponding department to cover all the manholes of the city within a month. Manhole Cover Manufacturing Corporation (MCMC) somehow managed to get the order. (Yes, this is a big deal, since a lot of manhole covers are to be made). MCMC makes the cover using steel, and they import polygonal steel sheets of different shapes and thickness from abroad. Then they melt the sheets to make the circular manhole covers, which also differ in size and thickness. MCMC needs a program which, given dimensions of a number of steel sheets, will calculate how many manhole cover can be made from these sheets. You are to help them by writing the program. Input The input file consists of several data blocks. Each data block starts with an integer N, the number of polygonal steel sheets. i-th line of the next N lines starts with thickness of the i-th sheet followed by co-ordinates of the polygon’s corner points in some order (clockwise or anti-clockwise). Each line consists of a series of real numbers in following format: TiX0Y0X1Y1X2Y2 . . . XnYnX0Y0 Where Ti is the thickness of the sheet, and XiYi are the coordinates of corner points. The line ends with co-ordinate of the first point. Last line of each data block will have two real numbers, R and T, radius and thickness of the manhole cover respectively. Input file ends with a data block with N = 0. Output For each data block, print the number of manhole cover in separate line. Sample Input 2 2 0 0 0 10 5 15 12 10 10 0 0 0 5 0 0 5 100 100 0 0 0 53 1 2 0 0 10 0 10 10 0 10 0 0 52 0 Sample Output 107 1