http://codeforces.com/problemset/problem/311/A
If we ignore "break", tot will be up to .
Consider whether we can make such inequality d ≤ p[j].x - p[i].x is always false. The obvious way is to make all points' x coordinates the same(WTF!!!). And we can just choose n distinct numbers to be all points' y coordinate.
Thus the problem is solved.
#include<cstdio>
int main()
{
int n, k;
scanf("%d%d", &n, &k);
if (k >= n * (n - 1) / 2) puts("no solution");
else for (int i = 1; i <= n; i++) printf("0 %d\n", i);
return 0;
}
【扩展】
如果要求每个x的横坐标都不相同呢?