int round(double x) {return (int)(x+(x<0?-0.5:0.5));}