#!/usr/bin/env perl use strict; use warnings; my ($px, $py) = split / /,<>; my ($qx, $qy) = split / /,<>; print int(abs($px - $qx) + abs($py - $qy)) / 2;