fork(1) download
  1. <?php
  2. $data=file_get_contents('php://stdin','r');
  3. $process=explode("\n",$data);
  4. unset($process[0]);
  5. array_walk($process,function(&$val,$key){
  6. $vals=explode(" ",$val);
  7. $x=intval($vals[0]);$y=intval($vals[1]);
  8. $min=sqrt($y*$y - $x*$x);
  9. $max=sqrt($x*$x + $y*$y);
  10. echo $min." ".$max."\n";
  11. });
  12.  
Success #stdin #stdout 0.01s 20520KB
stdin
3
4 5
10 12
10 20
stdout
3 6.4031242374328
6.6332495807108 15.620499351813
17.320508075689 22.360679774998