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

19305번 - Chalk Outline 스페셜 저지다국어

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

문제

Your friend Grace has an assignment. She has to draw a simple polygon. It must have exactly $n$ vertices. It must not intersect or touch itself. No three consecutive vertices of the polygon must be collinear. All coordinates of its vertices must be integers between $-10^9$ and 10ドル^9,ドル inclusive. Easy, right?

There is one more small restriction, though.

A diagonal of a polygon is a line segment connecting two non-neighboring vertices. We'll call a diagonal internal if every point lying on the diagonal (excluding vertices) lies strictly inside the polygon.

The number of internal diagonals of the polygon must be equal to $k$.

Grace has been trying to solve this problem for three days with no success. You are much more time-restricted, but have to help her anyway.

입력

The only line of the input contains two integers $n$ and $k$ (4ドル \le n \le 100$; 0ドル \le k \le \frac{n(n-3)}{2}$).

출력

If it's impossible to draw a polygon satisfying the requirements, output a single word "No".

Otherwise, output "Yes" followed by $n$ pairs of integers $x_i$ and $y_i$ ($-10^9 \le x_i, y_i \le 10^9$) --- coordinates of polygon vertices in clockwise or counterclockwise order.

The polygon must not intersect or touch itself. No two vertices must coincide. No three consecutive vertices must lie on the same line.

제한

예제 입력 1

5 4

예제 출력 1

Yes
0 0
3 0
2 1
3 2
0 2

예제 입력 2

5 2

예제 출력 2

Yes
0 0
2 0
1 1
2 2
0 2

예제 입력 3

4 0

예제 출력 3

No

힌트

In the second example test case, diagonals connecting vertices 1 and 4 and vertices 2 and 5 are not internal.

출처

Camp > Petrozavodsk Programming Camp > Winter 2018 > Day 6: Gennady Korotkevich Contest 3, Grand Prix of Gomel C번

Contest > Open Cup > 2017/2018 Season > Stage 12: Grand Prix of Gomel C번

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

출처

대학교 대회

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

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