http://codeforces.com/contest/456/problem/C