Why is this code not working for this question? Please tell me http://codeforces.com/problemset/problem/467/B