[Cpp]
# Include <iostream>
# Include <stdio. h>
# Include <algorithm>
# Include <vector>
# Include <cmath>
Using namespace std;
Struct Node {
Int x, y;
Double xx;
};
Bool cmp (Node a, Node B ){
Return (a. x> B. x );
}
Double distant (double x1, double y1, double x2, double y2 ){
Return sqrt (x1-x2) * (x1-x2) + (y1-y2) * (y1-y2 ));
}
Int work (int n, int d ){
Vector <Node> site;
Node tmp;
For (int I = 0; I <n; I ++ ){
Scanf ("% d", & tmp. x, & tmp. y );
If (tmp. y> d)
Return-1;
Tmp. xx = tmp. x + sqrt (d * d-tmp. y * tmp. y );
Site. push_back (tmp );
}
Sort (site. begin (), site. end (), cmp );
Int count = 1;
Double xx;
Tmp = site. back ();
Site. pop_back ();
Xx = tmp. xx;
While (! Site. empty ()){
Tmp = site. back ();
Site. pop_back ();
If (distant (tmp. x, tmp. y, xx, 0) <= d)
Continue;
Else if (tmp. xx <xx)
Xx = tmp. xx;
Else {
Count ++;
Xx = tmp. xx;
}
}
Return count;
}
Int main (){
Int n, d;
Int I = 0;
While (scanf ("% d", & n, & d) = 2 ){
If (n = 0 & d = 0)
Break;
I ++;
Int result = work (n, d );
Printf ("Case % d: % d \ n", I, result );
}
Return 0;
}
# Include <iostream>
# Include <stdio. h>
# Include <algorithm>
# Include <vector>
# Include <cmath>
Using namespace std;
Struct Node {
Int x, y;
Double xx;
};
Bool cmp (Node a, Node B ){
Return (a. x> B. x );
}
Double distant (double x1, double y1, double x2, double y2 ){
Return sqrt (x1-x2) * (x1-x2) + (y1-y2) * (y1-y2 ));
}
Int work (int n, int d ){
Vector <Node> site;
Node tmp;
For (int I = 0; I <n; I ++ ){
Scanf ("% d", & tmp. x, & tmp. y );
If (tmp. y> d)
Return-1;
Tmp. xx = tmp. x + sqrt (d * d-tmp. y * tmp. y );
Site. push_back (tmp );
}
Sort (site. begin (), site. end (), cmp );
Int count = 1;
Double xx;
Tmp = site. back ();
Site. pop_back ();
Xx = tmp. xx;
While (! Site. empty ()){
Tmp = site. back ();
Site. pop_back ();
If (distant (tmp. x, tmp. y, xx, 0) <= d)
Continue;
Else if (tmp. xx <xx)
Xx = tmp. xx;
Else {
Count ++;
Xx = tmp. xx;
}
}
Return count;
}
Int main (){
Int n, d;
Int I = 0;
While (scanf ("% d", & n, & d) = 2 ){
If (n = 0 & d = 0)
Break;
I ++;
Int result = work (n, d );
Printf ("Case % d: % d \ n", I, result );
}
Return 0;
}