You need to make a figure which will look like an inverted Y.
The leg of the Y = 16-x and the distance from the crotch of the Y to the country road is x.
The distance from the crotch to each house is sqrt(16+x2)
The length of wire w=16-x+2sqrt(16+x2)
dW/dx= -1+[2x/sqrt16+x2)]=0
x=(4/3)sqrt(3)
You can find 16-x which is the distance from the main highway.