solve the hdu 1318