use strict; use warnings; my ($xp, $yp) = split / /, <>; my $ans; my $r = sqrt($xp*$xp + $yp*$yp); if($r == int $r) { $ans = 2*(int $r) + 1; } else { $ans = 2*((int $r) + 1); } for(my $i = $ans / 2; $i > $r; $i -= 0.5) { $ans = $i * 2; } print "$ans\n"; exit;