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 = 0; }elsif($Y < 0){ $turn = 2; }elsif($Y > 0){ $turn = 1; } $count += $turn; print "$count\n";