Codeforces 315D: Accepted