Solutions for exercises available at pl.spoj.com