codeforces round 185
world finals warm up - UVa