package main import ( "fmt" "math" ) func main() { var x, y, x1, y1 float64 fmt.Scan(&x, &y, &x1, &y1) var ans float64 if (x == 0 && x1 == 0 && y > y1) || (y == 0 && y1 == 0 && x > x1) { ans += 2 } ans += max(math.Abs(x1-x), math.Abs(y1-y)) fmt.Println(ans) } func max(a, b float64) float64 { if a > b { return a } else { return b } }