m@main=getLine>>=print.round.(\p->sqrt$product[sum p/2-x|x<-0:p]).map read.words>>m