my $X = <>; my $Y = <>; my $K = <>; #to make a positive number my $pX = sqrt($X*$X); my $pY = sqrt($Y*$Y); my $remainder = ($pX+$pY) % $K; my $count = ($pX + $pY - $remainder)/$K; if($remainder != 0){ $count += 1; } my $turn; if($X == 0 && $Y < 0){ $turn = 2; }elsif($X > 0 && $Y == 0){ $turn = 1; }elsif($X < 0 && $Y == 0){ $turn = 1; }elsif($X > 0 && $Y <0){ $turn = 2; }elsif($X<0 && $Y>0){ $turn = 1; }elsif($X < 0 && $Y < 0){ $turn = 2; }elsif($X > 0 && $Y > 0){ $turn = 1 }else{ $turn = 0; } $count += $turn; print "$count\n";