segment tree hdu 1166