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