Utility method to compute total distance of all points when choose point on given line has x - coordinate value as X
static double compute ( point [ ] p , int n , line l , double X ) { double res = 0 ;