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