RiseOJ는 solved.ac와 제휴 관계가 없습니다. 티어 아이콘 © solved.ac. solved.ac
포럼
COCI00418

Meksikanac

Unrated 레이팅 미적용
난이도
1s
시간 제한
256MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 0

설명

1 \(s / 256\) \(MB / 160\) points

Do you know what is the difference between a hotel and a motel? That’s right, the difference

is in the number of flies that live there. Norman is an owner of one of the more popular

American motels, but his mother insists he turns it into a hotel. That’s exactly why Norman

got a flyswatter (a f\(ly-ki\)lling device) in the shape of a polygon with \(K\) edges as a Christmas

present in 2016.

Wanting to meet his mother’s demands, Norman found himself in front of a window with \(N\)

flies. Since Norman wouldn’t even harm a fly, he wants to know how many ways there are

for him to hit the window with the flyswatter, without harming a single fly.

The window is a rectangle with its lower left vertex placed in the center of the coordinate

system. After Norman’s blow to the window, the vertices of the polygon must lie on integer

coordinates, and the flyswatter must be located within the window with all its area. A fly is

considered hurt if it’s located on the vertex, edge or within the flyswatter.

제약

In test cases worth 62.5% of total points, it will hold 1 <= \(X\)

\(p\)

, \(Y\)

\(p\)

<= 100

입력 형식

The first line of input contains integers \(X\)

\(p\)

, \(Y\)

_{p} ^{and} ^{ }^{N} ^{(1} ^{<=} ^{ }^{X}

\(p\)

, \(Y\)

_{p} ^{<=} ^{500,} ^{0} ^{<=} ^{ }{N}}^{ }^{X

\(p\)

*Y

\(p\)

),

the coordinates of the upper right corner of the window and the number of flies on the

window, respectively.

Each of the following \(N\) lines contains two integers \(X\) and \(Y\) (0 < \(X\) < \(X\)

\(p\)

,

0 < \(Y\) < \(Y\)

\(p\)

), the

coordinates of a fly on the window.

The following line contains the integer \(K\) (3 <= \(K\) <= 10000), the number of vertices of the

flyswatter.

Each of the following \(K\) lines contains two integers \(X\)

\(i\)

, \(Y\)

_{i} {(-10}{ }{9}}^{ }^{X

\(i\)

, \(Y\)

_{i} ^{<= 10}^{ }{9}{ }^{), the}^{ }^{i}

\(th\) vertex

of the flyswatter. The flyswatter vertices are provided in order of joining lines, so

neighbouring vertices are connected by a straight line.

출력 형식

You must output how many ways there are for Norman to hit the window with the flyswatter,
without harming a single fly.

예제 1
입력
4 5 2
1 3
3 4
4
0 0
2 0
2 2
0 2
출력
4
예제 2
입력
5 5 3
1 4
1 3
2 2
3
4 7
6 3
7 6
출력
3
예제 3
입력
6 7 2
2 5
4 5
8
1 4
3 3
4 1
5 3
7 4
5 5
4 7
3 5
출력
1
문제 정보

생성자가 기록되지 않았습니다.

출처 COCI 2016/2017 Contest 3

평가 및 의견

Meksikanac

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

Meksikanac

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8