solve 1230_Nim.cpp