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

Pick

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

의견: 0

설명

1 sekun\(da / 1024\) M\(iB / 100\) points
Mirko recently read about Pick’s theorem that says the following: in the coordinate system, if we draw
a polygon whose vertices are points with integer coordinates, and if \(A\) denotes its area, \(i\) the number
of points with integer coordinates located inside the polygon, and \(b\) the number of points with integer
coordinates located on its edges (including the polygon’s vertices), then it always holds:
\(A = i\) + ^{b}
2 {−}}^{.
In order to test the theorem, Mirko used his smart board to create a polygon from magnetic sticks that
have, during the night, sunk to the bottom of the board because due to gravity. Now, Mirko wants to
construct a polygon of the minimal possible area while using all the sticks he found. Mirko can move the
sticks anywhere on his board, but he must not rotate them. Mirko is equipped with the following:
\(a\) horizontal sticks of length 1,
\(b\) vertical sticks of length 1,
\(c\) diagonal sticks of length

2 that form a \(45^{◦}\)angle with the positive part of \(x-ax\)is,
\(d\) diagonal sticks of length

2 that form a \(135^{◦}\)angle with the positive part of \(x-ax\)is.
Figure 2: For the polygon above: \(A = 8\), \(i = 4\), \(b = 10\).
a
b
c
d
Figure 3: The sticks Mirko is equipped with.
Determine the polygon of the minimal possible area that can be obtained so that all the sticks are used.
You can assume that the input data is such that it is possible to construct at least one such polygon.
Also, it is possible to score partial points if, using all of the given sticks, you construct a valid polygon
(that is not necessarily of the minimal possible area). For more details, consult the section “Scoring”.

제약

Subtask 1 (5 points): \(c = d = 0\)

Subtask 2 (5 points): \(a = b = 0\)

Subtask 3 (10 points): \(a + b + c + d \le 6\)

Subtask 4 (10 points): \(a + b + c + d \le 20\)

Subtask 5 (10 points): \(a + b + c + d \le 40\)

Subtask 6 (10 points): \(a + b + c + d \le 80\)

Subtask 7 (10 points): \(a + b + c + d \le 150\)

Subtask 8 (10 points): \(a + b + c + d \le 200\)

Subtask 9 (10 points): \(a + b + c + d \le 300\)

Subtask 10 (20 points): no additional constraints If, for a test case, your solution does not output a valid polygon that consists of the given sticks, then it scores 0 points for the corresponding subtask. If the solution outputs a valid polygon that is not of the minimal possible area, then it can score partial points according to the following rules. For test case \(j\), let \(r_{j}\) denote the ratio of area of the obtained polygon and the minimal possible polygon area. For subtask \(k\), let’s denote with \(zk\) the largest of the numbers \(rj\), where \(j\) is the test case from subtask \(k\). The percentage of points \(Pk\) that the solution scores for subtask \(k\) depends on the number \(zk\) in the following way: \(P_{k} = 10\) if \(z_{k} \ge 3\), and otherwise it is calculated as: \(Pk\) = ^{25} 8 {(3}{z}{)} Therefore, a solution that is not optimal can score between 10% and 60% points for a certain subtask, depending on the ratio of the area of the obtained polygon and the optimal one.}^{+ 10}^{.

입력 형식

The first line of input contains four integers a, b, c, d from the task.

출력 형식

You must output \(n\) lines where \(n = a + b + c + d\). In the \(j\)th line, output integers \(xj\) and \(yj\) — the
coordinates of the \(j\)th polygon vertex. The first polygon vertex must be (0, 0), and the other vertices
can be printed in an arbitrary direction (either positive or negative). It is allowed that the consecutive
polygon sides are parallel, but the polygon cannot touch or intersect itself.
1 sekun\(da / 1024\) M\(iB / 100\) points

서브태스크
서브태스크점수설명

1

5점

\(c = d = 0\)

2

5점

\(a = b = 0\)

3

10점

\(a + b + c + d \le 6\)

4

10점

\(a + b + c + d \le 20\)

5

10점

\(a + b + c + d \le 40\)

6

10점

\(a + b + c + d \le 80\)

7

10점

\(a + b + c + d \le 150\)

8

10점

\(a + b + c + d \le 200\)

9

10점

\(a + b + c + d \le 300\)

10

20점

no additional constraints If, for a test case, your solution does not output a valid polygon that consists of the given sticks, then it scores 0 points for the corresponding subtask. If the solution outputs a valid polygon that is not of the minimal possible area, then it can score partial points according to the following rules. For test case \(j\), let \(r_{j}\) denote the ratio of area of the obtained polygon and the minimal possible polygon area. For subtask \(k\), let’s denote with \(zk\) the largest of the numbers \(rj\), where \(j\) is the test case from subtask \(k\). The percentage of points \(Pk\) that the solution scores for subtask \(k\) depends on the number \(zk\) in the following way: \(P_{k} = 10\) if \(z_{k} \ge 3\), and otherwise it is calculated as: \(Pk\) = ^{25} 8 {(3}{z}{)} Therefore, a solution that is not optimal can score between 10% and 60% points for a certain subtask, depending on the ratio of the area of the obtained polygon and the optimal one.}^{+ 10}^{.

예제 1
입력
1 1 1 0
출력
0 0
1 1
0 1
예제 2
입력
0 0 6 4
출력
0 0
1 1
2 2
3 3
2 4
1 3
0 2
-1 3
-2 2
-1 1
문제 정보

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

출처 COCI 2017/2018 Olympiad

평가 및 의견

Pick

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

Log in to rate problems.

개별 의견

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

풀이 제출

Pick

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