Solve div2 hard.
Merge pull request #4 from matscube/SRM632

Solve div2 hard.