<?php
$a = (int) trim(fgets(STDIN));
do {
    $b = (int) trim(fgets(STDIN));
} while ($b == 0);
$aa = 0;
$bb = 0;
if ($a < 0) {
    $aa = -($a);
}
    else {
        $aa = $a;
    }
if ($b < 0) {
    $bb = -($b);
}
    else {
        $bb = $b;
    }
for ($i = 0; $aa >= $bb; $aa -= $bb, $i++);
if ($a < 0 xor $b < 0) {
    $i = -$i;
}
echo $i."\n", $aa."\n";
?>

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: