#include #include #include #include #include #include using namespace std; #define double float #define REP(i,n) for(int i = 0; i < (n); ++i) #define FOR(i,a,b) for(int i = (a); i <= (b); ++i) #define FORD(i,a,b) for(int i = (a); i >= (b); --i) #define PRINTF(args...) printf(args) // #define PRINTF(args...) struct punkt { double x,y; punkt(){} punkt(double xx, double yy): x(xx), y(yy){} int dist(const punkt& co) { return (x-co.x)*(x-co.x) + (y-co.y)*(y-co.y); } int norm() const { return x*x+y*y; } punkt r90() { return punkt(-y, x); } }; inline punkt operator-(const punkt &a, const punkt &b) { return punkt(a.x-b.x, a.y-b.y); } inline punkt operator+(const punkt &a, const punkt &b) { return punkt(a.x+b.x, a.y+b.y); } inline punkt operator*(const punkt &a, double f) { return punkt(a.x*f, a.y*f); } inline punkt operator/(const punkt &a, double f) { return punkt(a.x/f, a.y/f); } const int maxn=2101; punkt T[maxn]; int ziomy[maxn][maxn]; int cnts[maxn]; double R; // znajdze 2 okresgi o promienniu R wyznaczone przez A,B inline void find_kolo(const punkt & A, const punkt & B, punkt wynik[]) { double r1 = R; // R punkt d(B-A); int dist = d.norm(); r1 *= r1/dist; // r2 *= r2/dist; punkt p = A + d*0.5, offset = d.r90()*sqrt(r1 - 0.25); //printf("Aaaaaa: %lf %lf\n", p.x, p.y, offset.x, offset.y); wynik[0] = p+offset; wynik[1] = p-offset; } int main() { int n,r; while (true) { scanf("%d%d", &n, &r); R=r+0.00005; if (n==0 && r==0) break; for (int i=0; i T[i].dist(T[j])) ziomy[i][cnts[i]++] = j; } } punkt t[2]; int best = 0, akt, k; for (register int i=0; i?= akt; if (best == 3) goto poza; } } } poza:; printf("It is possible to cover %d points.\n", best+1); } return 0; }