Can Anyone give the idea for the following Problem ↵
[LOJ — 1021 Painful Bases](http://www.lightoj.com/volume_showproblem.php?problem=1021&language=english&type=pdf)↵
[LOJ — 1021 Painful Bases](http://www.lightoj.com/volume_showproblem.php?problem=1021&language=english&type=pdf)↵