obstacle COURSE not getting answer.

#include<stdio.h>
#include<math.h>

int ischarspace(char x)
{
return x==' '||x=='\n'||x=='\r';
}


inline void fastread(int *x)
{
char c;
int f=0;
*x=0;
c=getchar_unlocked();
while(ischarspace(c))
c=getchar_unlocked();
if(c=='-')
{f=1;
c=getchar_unlocked();
}
while(!ischarspace(c))
{
*x= *x * 10 +(c-48);
c=getchar_unlocked();
}
if(f==1)
*x=-*x;
}



int main()
{
int t,x,y,i,j,n,a,b;
double mid,len,min,ans;
fastread(&t);
while(t--)
{ 
//fastread(&x);
fastread(&x);
fastread(&y);
mid=((double)(y-x)/2);
min=mid;
fastread(&n);
while(n--)
{
fastread(&i);
fastread(&j);
**a=i*i;
b=j*j;
len=sqrt(a+b);   //distance from center
//printf("len = %f\n",len);
len=mid+x-len; // distance from mid of course width
//printf("len = %f\n",len);
if(len<0)
len=-len;
if (len<min)
min=len; //distance of cone which is at min dis 
//printf("min=%f\n",min);
}
ans=mid+min;//diameter of car**
printf("%.3lf\n",ans);
}
return 0;
}

heres my code it is satisfying the sample but online judge is giving wrong answer…
please someone tell whats the mistake in ma code…


thank you…

You are not considering the case when two obstacles are in same line.

1 Like

thanks jatin for your help…

//