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: #include <bits/stdc++.h>
using namespace std;

float dist(int x1, int y1, int x2, int y2)
{
    return sqrt(pow(x2-x1,2) + pow(y2-y1,2));
}

int main()
{
    int x, y, x1, y1, x2, y2;
    cin >> x >> y >> x1 >> y1 >> x2 >> y2;
    float d = dist(x,y,x1,y1);
    d = min(d, dist(x,y,x1,y2));
    d = min(d, dist(x,y,x2,y2));
    d = min(d, dist(x,y,x2,y1));
    if (x > x1 and x < x2)
    {
        d = min(d, dist(x,y,x,y1));
        d = min(d, dist(x,y,x,y2));
    }
    if (y > y1 and y < y2)
    {
        d = min(d, dist(x,y,x1,y));
        d = min(d, dist(x,y,x2,y));
    }
    
    printf("%.3f", d);
    return 0;
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?