For this Question: You have a house, which you model as an axis-aligned rectangle with corners at (x1, y1) and (x2, y2).
You also have a goat, which you want to tie to a fence post located at (x, y), with a rope of length
l. The goat can reach anywhere within a distance l from the fence post.
Find the largest value of l so that the goat cannot reach your house.Input consists of a single line with six space-separated integers x, y, x1, y1, x2, and y2. All the
values are guaranteed to be between −1000 and 1000 (inclusive).
It is guaranteed that x1 < x2 and y1 < y2, and that (x, y) lies strictly outside the axis-aligned
rectangle with corners at (x1, y1) and (x2, y2).Print, on one line, the maximum value of l, rounded and displayed to exactly three decimal placessample input 
7 4 0 0 5 4

sample output
2.000

sample input
6 0 0 2 7 6

sample output
2.000

sample input
4 8 7 8 9 9

sample output 
3.000, I have written this Solution Code: import java.io.*;
import java.util.*;



class Main {
	static double distance(int x,int y,int x1,int y1)
	{
		return Math.sqrt(((x-x1)*(x-x1))+((y-y1)*(y-y1)));
	}
	public static void main (String[] args) throws IOException{
		BufferedReader scan=new BufferedReader(new InputStreamReader(System.in));
		String s[]=scan.readLine().split(" ");
		int x=Integer.parseInt(s[0]);
		int y=Integer.parseInt(s[1]);
		int x1=Integer.parseInt(s[2]);
		int y1=Integer.parseInt(s[3]);
		int x2=Integer.parseInt(s[4]);
		int y2=Integer.parseInt(s[5]);
		double ans=0.0;
		if(x>=x1&&x<=x2)
		{
			ans=Math.min(Math.abs(y-y1),Math.abs(y-y2));
		}
		else if(y>=y1&&y<=y2)
		{
			ans=Math.min(Math.abs(x-x1),Math.abs(x-x2));
		}
		else
		{
			ans=distance(x,y,x1,y1);
			ans=Math.min(ans,distance(x,y,x2,y2));
			ans=Math.min(ans,distance(x,y,x1,y2));
			ans=Math.min(ans,distance(x,y,x2,y1));
		}
		System.out.printf("%.3f",ans);


	}
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?