Codeforces 312C: Accepted