Simple Polygon

아직 제출이 없습니다메모리 제한1024 MB

문제

You are given two integers, the number of vertices NN and area AA. You need to construct a simple polygon of NN vertices such that the area of the polygon is exactly A2\frac{A}{2}, and all the vertices have non-negative integer coordinates with value up to 10910^9.

A simple polygon is one that:

  • Defines a closed area.
  • Does not have self-intersections, even at a single point.
  • No two consecutive edges form a straight angle.

입력

The first line of the input gives the number of test cases, TTTT lines follow. The first line of each test case contains two integers, NN denoting the number of vertices and AA, denoting double the required area of the polygon.

출력

For each test case, output one line containing Case #x: y, where xx is the test case number (starting from 1) and yy is IMPOSSIBLE if it is not possible to construct a polygon with the given requirements and POSSIBLE otherwise.

If you output POSSIBLE, output NN more lines with 22 integers each. The ii-th line should contain two integers X_iX\_i and Y_iY\_i which denote the coordinates of the ii-th vertex. For each ii, the coordinates should satisfy the 0X_i,Y_i1090 \le X\_i,Y\_i ≤ 10^9 constraints. Vertices of the polygon should be listed in consecutive order (vertex_ivertex\_i should be adjacent to vertex_i1vertex\_{i-1} and vertex_i+1vertex\_{i+1} in the polygon).

If there are multiple possible solutions, you can output any of them.

제한

  • 1T1001 \le T \le 100.
  • 1A1091 \le A \le 10^9.