Help me in solving COMM3 problem

My issue

what is wrong with my code, i don’t see any problem here

My code

import java.util.*;
import java.lang.*;
import java.io.*;
class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
		int hi = sc.nextInt();
		while(hi-->0)
		{
		  int r = sc.nextInt();
		  int[][] ar = new int[3][2];
		  for(int i=0;i<3;i++){
		    for(int j=0;j<2;j++){
		        ar[i][j] = sc.nextInt();
		    }
		  }
		  double d1 = Math.sqrt(Math.pow((ar[0][0]-ar[1][0]),2)+(Math.pow((ar[0][1]-ar[1][1]),2)));
		  double d2 = Math.sqrt(Math.pow((ar[1][0]-ar[2][0]),2)+(Math.pow((ar[1][1]-ar[2][1]),2)));
		  double d3 = Math.sqrt(Math.pow((ar[0][0]-ar[2][0]),2)+(Math.pow((ar[0][1]-ar[2][1]),2)));
		  if((d1<=r && d2<=r) || (d2<=r && d3<=r) || (d1<=r && d3<=r))
		    System.out.println("Yes");
		  else
		    System.out.println("No");
		}
	}
}

Problem Link: Three Way Communications Practice Coding Problem