Codeforces Round 248 Div.1 Problem A&B