#include #include #include using namespace std; int N, R, k; double DR; int result[100001]; struct INPUTMEMORY{ int x, y; }im[100001]; struct INPUTPOINTS{ int x, y, n; int passive; bool operator < (INPUTPOINTS &a) { if (this->x < a.x) return true; else if(this->x == a.x) return this->y < a.y; return false; } }inp[100001]; int TestDistance(int n) { double top, down, left; top = inp[n].y + DR; down = inp[n].y - DR; left = inp[n].x - DR; for (int i = n - 1; i >= 1; i--) { if (inp[i].y > top || inp[i].y < down || inp[i].x < left) continue; if (inp[i].passive) continue; double A = inp[n].x - inp[i].x; double B = inp[n].y - inp[i].y; if (sqrt(A * A + B * B) < DR) { inp[n].passive++; return 0;} } return 1; } void Solve() { sort(&inp[1], &inp[N+1]); for (int i = 1; i <= N; i++) { if (TestDistance(i)) { k++; result[k] = inp[i].n; } } } void Input() { scanf("%i %i\n", &N, &R); DR = R + R; for (int i = 1; i <= N; i++) { scanf("%i %i\n", &inp[i].x, &inp[i].y); inp[i].n = i; } } void Output() { printf("%i\n", k); for (int i = 1; i <= k; i++) { printf("%i ", result[i]); } } int main() { freopen("mars.in", "r", stdin); freopen("mars.out", "w", stdout); Input(); Solve(); Output(); return 0; }