hdu-1561.cpp  Accepted