Personal problem solutions on the poj. It'll be great if it happens to be useful for you.