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

19137번 - Simple Polygon 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB43131343.333%

문제

Although bobo is truly smart, he just like you to find a simple polygon for him. The polygon you are going to find should satisfy the following conditions.

  1. The polygon is simple. That is to say, any two non-adjacent edges won't intersect or touch and any two adjacent edges have exactly one common point.
  2. Edges of the polygon are parallel to either $x$-axis or $y$-axis.
  3. The perimeter of the polygon equals to $l,ドル while the area equals to $s$.

입력

First line of the input contains two integers $l$ and $s$ (4ドル \leq l \leq 10^9, 1 \leq s \leq 10^9$).

출력

The first line contains an integer $n,ドル which denotes the number of vertices of the polygon you have found (4ドル \leq n \leq 1000$).

Each of the following $n$ lines contains 2ドル$ integers $x_i, y_i,ドル which denote the coordinates of points (in clockwise or counter-clockwise order) (0ドル \leq x_i, y_i \leq 10^9$).

Any appropriate solution will get accepted.

If no such polygon can be found, simply print "-1".

제한

예제 입력 1

4 1

예제 출력 1

4
0 0
1 0
1 1
0 1

예제 입력 2

4 2

예제 출력 2

-1

힌트

출처

Camp > Petrozavodsk Programming Camp > Winter 2015 > Day 3: Chinese Contest D번

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

출처

대학교 대회

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

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