Skip to main content
Back to problems
Codeforces
Medium
Geometry
Combinatorics
Math
Beautiful Sets of Points

Count or construct all valid point sets formed from a simple geometric rule over integer coordinates.

Acceptance 0%
Also Available On
Other platform versions and source mappings for the same problem.
Problem Statement

Problem

You are given a positive integer nn. Consider a set of points with integer coordinates on a 2D plane. A set is called beautiful if it satisfies the geometric rule described in the task and contains exactly nn points.

Your job is to determine whether such a set exists, and if so, construct one valid example of a beautiful set of nn points.

The intended solution is based on observing the pattern of valid point placement and building the answer directly rather than searching over all possibilities.

Notes

  • Points are represented as pairs (x,y)(x, y).
  • Any valid construction is accepted.
  • If multiple answers exist, output any one of them.

Input Format

  • The first line contains an integer nn.

Output Format

  • If a beautiful set of nn points can be constructed, output the coordinates of the points in any valid order.
  • Otherwise, output the appropriate impossible indication required by the problem statement.

Constraints

  • 1≤n1 \le n is within the problem's original limits.
  • Coordinates should be integers.
  • The construction must satisfy the geometric condition from the statement.
Examples
Sample cases returned by the problem API.

Example 1

Input

3

Output

0 0
1 0
0 1

Explanation

This is a small illustrative construction of three integer points. The exact validity depends on the hidden geometric condition from the original problem statement.

Premium problem context

Unlock deeper context for this problem

Premium adds guided hints, editorial links, similar variants, discussion resources, and concept maps so you can understand why a problem matters, not just solve it once.

Guided hints
Editorial and discussion links
Concept map and variants
Sign in to unlock
Track your progress
Sign in to bookmark this problem, save notes, and manage its revision plan.