Logo
(追記) (追記ここまで)

22790번 - Inside Information 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB608412.500%

문제

You are given the vertices of a simple, convex polygon. “Simple” means that there are no crossing or overlapping edges. “Convex” means that, as you walk around the polygon, you keep moving consistently clockwise (or counterclockwise) relative to any point strictly inside the polygon. You are also given a set of points. Your task is to find the number of those points that are enclosed by the polygon. Points are “enclosed” if they are inside the polygon, or lie on an edge, or are coincident with a polygon vertex. All points and polygon vertices lie on an integer grid, with absolute coordinate values being less than 1000.

입력

There will be one or more data sets in the input file. Each data set contains:

  • First line: the number of vertices (n, with 3 ≤ n ≤ 100), and the number of points (m, with 1 ≤ m ≤ 100)
  • Next n lines: x- and y-coordinates of polygon vertices in either clockwise or counterclockwise order.
  • Next m lines: x- and y-coordinates of points.

The last data set contains 0 0 for the first line, and is not to be processed.

출력

For each data set, print the number of the set, where the first set is set 1, and the number of points enclosed.

제한

예제 입력 1

4 6
0 0
2 2
5 5
5 –1
5 3
7 3
5 –1
5 –2
2 2
4 1
3 1
0 0
5 0
5 5
0 5
0 0

예제 출력 1

Data set 1: 4
Data set 2: 0

힌트

출처

ICPC > Regionals > North America > Southeast USA Regional > 1999 Southeast USA Regional Programming Contest ?번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /