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

6632번 - Arable Area 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB7016919.149%

문제

The prime minister has recently bought a piece of valuable agricultural land, which is situated in a valley forming a regular grid of unit square fields. ACM would like to verify the transaction, especially whether the price corresponds to the market value of the land, which is always determined as the number of unit square fields fully contained in it.

Your task is to write a program that computes the market value. The piece of land forms a closed polygon, whose vertices lie in the corners of unit fields.

For example, the polygon in the picture (it corresponds to the first scenario in Sample Input) contains three square fields.

입력

The input consists of several test scenarios. Each scenario starts with a line containing one integer number N (3 ≤ N ≤ 100), the number of polygon vertices. Each of the following N lines contains a pair of integers Xi and Yi, giving the coordinates of one vertex. The vertices are listed in the order they appear along the boundary of the polygon. You may assume that no coordinate will be less then −100 or more than 100 and that the boundary does not touch or cross itself.

The last scenario is followed by a line containing single zero.

출력

For each scenario, output one line with an integer number — the number of unit squares that are completely inside the polygon.

제한

예제 입력 1

4
1 1
5 3
5 4
3 5
5
3 3
2 5
3 4
5 2
1 1
5
0 0
0 -50
-50 -51
-51 -50
-50 0
0

예제 출력 1

3
1
2500

힌트

출처

ICPC > Regionals > Europe > Central European Regional Contest > CTU Open Contest > CTU Open Contest 2009 A번

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

출처

대학교 대회

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

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