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