Codeforces Round 185 (Div. 1)
A
The Closest Pair
Codeforces
1300
原题
←B →
翻译中…

Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceeded.

翻译中…

The problem is the follows. Given $*n*$ points in the plane, find a pair of points between which the distance is minimized. Distance between $(*x*_{1}, *y*_{1})$ and $(*x*_{2}, *y*_{2})$ is image.

翻译中…

The pseudo code of the unexpected code is as follows:

翻译中…

input n
for i from 1 to n
    input the i-th point's coordinates into p[i]
sort array p[] by increasing of x coordinate first and increasing of y coordinate second
d=INF        //here INF is a number big enough
tot=0
for i from 1 to n
    for j from (i+1) to n
        ++tot
        if (p[j].x-p[i].x>=d) then break    //notice that "break" is only to be
                                            //out of the loop "for j"
        d=min(d,distance(p[i],p[j]))
output d

翻译中…

Here, $*tot*$ can be regarded as the running time of the code. Due to the fact that a computer can only run a limited number of operations per second, $*tot*$ should not be more than $*k*$ in order not to get Time Limit Exceeded.

翻译中…

You are a great hacker. Would you please help Tiny generate a test data and let the code get Time Limit Exceeded?

翻译中…

Input

翻译中…

A single line which contains two space-separated integers $*n*$ and $*k*$ ($2 ≤ *n* ≤ 2000$, $1 ≤ *k* ≤ 10^{9}$).

翻译中…

Output

翻译中…

If there doesn't exist such a data which let the given code get TLE, print "no solution" (without quotes); else print $*n*$ lines, and the $*i*$-th line contains two integers $*x*_{*i*}, *y*_{*i*}$ $(|*x*_{*i*}|, |*y*_{*i*}| ≤ 10^{9})$ representing the coordinates of the $*i*$-th point.

翻译中…

The conditions below must be held:

翻译中…
  • All the points must be distinct.
  • $|*x*_{*i*}|, |*y*_{*i*}| ≤ 10^{9}$.
  • After running the given code, the value of $*tot*$ should be larger than $*k*$.
翻译中…

样例

Input #1
4 3
Output #1
0 0
0 1
1 0
1 1
InputCopy OutputCopy
Input #2
2 100
Output #2
no solution
InputCopy OutputCopy
题目信息
题号
311A
时间限制
2 s
内存限制
256 MB
标签
构造
模拟

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。