codeforces 180 div2,D.