http://codeforces.com/problemset/problem/431/A