A solution of POJ 3255 Roadblocks