시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 0 0 0 0.000%

## 문제

One of the causes (and consequences) of the financial crisis is the large number of home foreclosures. The fact that many derivatives were backed by mortgages, on which the homeowners then foreclosed, is part of the problem that financial institutions are facing. In turn, by losing work and other income sources, individuals cannot make their mortgage payments any more, and need to foreclose their homes. As you might expect, it’s a bit of a vicious cycle.

Some areas are harder hit than others by this. There are areas where a significant percentage of homes is in foreclosure right now. You are to write a program that finds out which areas are most affected.

You will be given the coordinates of houses, and whether or not they are in foreclosure. Then, you will be given simple (i.e., not self-intersecting) polygons representing different boroughs or areas. These polygons might overlap. You are to compute the percentage of houses in foreclosure in each of them, and to sort the boroughs by this foreclosure rate.

## 입력

The first line contains the number K of data sets. This is followed by K data sets, each of the following form:

The first line contains two integers H,B, the number of houses (1 ≤ H ≤ 1000) and boroughs (1 ≤ B ≤ 100), respectively. This is followed by H lines, each describing a house, by giving its x and y coordinates (floating point numbers), and a character ‘Y’ (in foreclosure) or ‘N’ (not in foreclosure).

This is followed by the description of B boroughs. Each borough is described by a line. The first entry of the line is an integer c ≥ 3, the number of corner points of the polygon. This is followed by 2c floating point numbers. Each pair of floating point numbers describes one of the c corners, in the order x1,y1,x2,y2,... ,xc,yc. The points will be given in counter-clockwise order.

Our inputs will ensure that no house lies exactly on the border of a borough. Also, each borough will contain at least one house.

## 출력

For each data set, output “Data Set x:” on a line by itself, where x is its number. Then, on c lines, output the foreclosure rates for all boroughs. Sort the lines by non-increasing foreclosure rates, breaking ties by lower borough number. Each line should first contain the number of the borough, and then the foreclosure rate, rounded to two decimals. Each data set should be followed by an empty line.

## 예제 입력 1

1
8 3
0 0 Y
0 1 N
1 0.5 N
0.7 0.7 Y
-0.5 0 N
-5 0 N
0.7 0 Y
3.4 0.95 N
3 -1 -0.5 1 -0.5 -1 0.75
4 -0.2 -0.5 1 -0.2 3 1.5 -0.2 1.5
5 0.5 0 1.5 -0.2 4 1.2 1 0 0.5 1.5


## 예제 출력 1

Data Set 1:
3: 66.67%
2: 60.00%
1: 50.00%
{"ft_lang_label":"__label__en","ft_lang_prob":0.93437034,"math_prob":0.9820879,"size":2628,"snap":"2019-51-2020-05","text_gpt3_token_len":743,"char_repetition_ratio":0.13376525,"word_repetition_ratio":0.0,"special_character_ratio":0.28805175,"punctuation_ratio":0.15619968,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.954962,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-12-15T03:01:52Z\",\"WARC-Record-ID\":\"<urn:uuid:f182c11d-b6d6-46f6-8819-665be14ff91f>\",\"Content-Length\":\"29642\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:bc0cd6bc-42c6-4adc-8f93-88611e033ab3>\",\"WARC-Concurrent-To\":\"<urn:uuid:ae8314db-8aeb-40dc-be38-bd442edfacef>\",\"WARC-IP-Address\":\"54.178.205.255\",\"WARC-Target-URI\":\"https://www.acmicpc.net/problem/5160\",\"WARC-Payload-Digest\":\"sha1:IGMLDHKI6ORBMOCTQBAVIDJZEH3RPFEG\",\"WARC-Block-Digest\":\"sha1:EFZJVG36A3LCJ6547CTV4542ZZKXTGVR\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-51/CC-MAIN-2019-51_segments_1575541301014.74_warc_CC-MAIN-20191215015215-20191215043215-00357.warc.gz\"}"}