refactor srm631/Div2Hard.cpp