http://codeforces.com/problemset/problem/447/B