foreach a\ b [read stdin] {puts [expr $a+2+$b*$b/$a>>2]}