256B: http://codeforces.com/contest/448/problem/B