/* ***********************************************
Author :xryz
Email :523689985@qq.com
Created Time :4-4 10:03:00
File Name :Transmitters.cpp
************************************************ */
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <math.h>
#include <stdlib.h>
#include <time.h>
using namespace std;
bool dis(double x1,double y1,double x0,double y0,double r)
{
double sum=(x1-x0)*(x1-x0)+(y1-y0)*(y1-y0);
if(sum>r) return 0;
return 1;
}
bool fnc(double x1,double y1,double x2,double y2)
{
double t=x1*y2-x2*y1;
if(t<=0) return 1;
return 0;
}
int main()
{
double x0,y0,r,x[160],y[160],in[160];
int sum,ans,i,n,j;
while(~scanf("%lf %lf %lf",&x0,&y0,&r))
{
if(r<0) break;
r=r*r;
ans=0;
memset(in,0,sizeof(in));
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%lf%lf",&x[i],&y[i]);
in[i]=dis(x[i],y[i],x0,y0,r);
}
sum=0;
for(i=0;i<n;i++)
{
if(in[i])
{
sum=0;
for(j=0;j<n;j++)
{
//if(i==j) continue;
if(in[j])
{
if(fnc(x[i]-x0,y[i]-y0,x[j]-x0,y[j]-y0))
sum++;
}
}
if(sum>ans) ans=sum;
}
}
printf("%d
",ans);
}
return 0;
}
版权声明:本文为博主原创文章,未经博主允许不得转载。http://xiang578.top/