solve codeforces 489A
solve codeforces 489B