hdu 1520. Anniversary party. Tree DP