1512a codeforces solution