= 0)) { $med = intdiv($left + $right, 2); } else { $med = intdiv($left + $right - 1, 2); } $y = pow($med, 3) + $A * pow($med, 2) + $B * $med + $C; if($y > 0) { $right = $med; } else if($y < 0) { $left = $med + 1; } else { $x1 = $med; break; } } $b = $A + $x1; $c = $x1 * $A + pow($x1, 2) + $B; $x2 = ((-1) * $b - sqrt(pow($b, 2) - 4 * $c)) / 2; $x3 = ((-1) * $b + sqrt(pow($b, 2) - 4 * $c)) / 2; $ans = array($x1, $x2, $x3); sort($ans); for($i = 0; $i < 3; $i++) { print($ans[$i]); if($i < 2) print(" "); } print("\n"); ?>