for input i have used fast IO using register…but i am getting a wrong answer,but if i use scanf the code is accepted…
its for the first time i am getting wa for input…i am not getting the logic behind this…
for this question i am getting a WA.
question link
NOTE : sf is for scanf in this code -_-
my code :-
#include<cstdio>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#define getcx getchar_unlocked
int sf()
{
register int c = getcx();
int num = 0;
for(; c < '0' || c > '9'; c = getcx());
for(; c >= '0' && c <= '9'; c = getcx())
num = (num << 3) + (num << 1) + c - 48;
return num;
}
int main()
{
int t;
t = sf();
while(t--)
{
int r;
r = sf();
int ax,ay,bx,by,cx,cy;
ax = sf();
ay = sf();
bx = sf();
by = sf();
cx = sf();
cy = sf();
//scanf("%d%d%d%d%d%d%d",&r,&ax,&ay,&bx,&by,&cx,&cy);
r*=r;
int ab,bc,ac;
ab = (ax-bx)*(ax-bx)+(ay-by)*(ay-by);
bc = (bx-cx)*(bx-cx)+(by-cy)*(by-cy);
ac = (ax-cx)*(ax-cx)+(ay-cy)*(ay-cy);
int count = 0;
if(ab<=r)
count++;
if(bc<=r)
count++;
if(count<2)
if(ac<=r)
count++;
if(count>1)
printf("yes\n");
else
printf("no\n");
}
return(0);
}