POJ#2363 enumeration problem, simple math. Rank:12980