Solutions for spoj.com