Under construction

Still being built. Things may change

Chino's Latte Art

Time limit1sMemory limit1024 MB

Summary
Construct a simple polygon with exactly 100000 vertices that is heart-shaped, symmetric about line AB, with coordinates within 2,000,000 in absolute value.
Level

Hard8 of 10

Topics
Geometry, Implementation, Math
Solved
No attempts yet

Problem

While looking for heart shapes in Chino's Latte Art (Hard), Cocoa wondered: can a latte art that is both a polygon and heart-shaped be made very small and delicate? Help Cocoa answer her question.

A polygon is defined as heart-shaped if there exist polygon vertices AA and BB such that all of the following conditions hold.

  • The interior angle at AA is less than 180180 degrees, and the interior angle at BB is greater than 180180 degrees.
  • The given polygon is symmetric about the line ABAB.
  • When the given polygon is split by the segment ABAB, both resulting parts are convex polygons.

Input

A single value NN (N=100 000N=100\,000) is given.

Output

Print the coordinates of the vertices of a polygon representing the latte art, starting from any vertex and listing them in clockwise order. On the ii-th line, print the xx and yy coordinates of the ii-th point, in that order.

The polygon must satisfy the following conditions.

  • It must be a simple polygon with exactly NN vertices.
  • No vertex may have an interior angle of exactly 180180 degrees.
  • Every vertex (x,y)(x,y) must have integer coordinates satisfying −2 000 000≤x,y≤2 000 000-2\,000\,000\le x,y\le 2\,000\,000.
  • It must satisfy the heart-shape conditions defined above.

Examples1

  1. Example 1

    Input
    6
    
    Expected output
    0 0
    0 5
    3 5
    3 3
    5 3
    5 0