http://codeforces.com/contest/385/problem/A
http://codeforces.com/contest/385/problem/B