I have tried but can\'t do. Please someone explain. I have tried the brute force approach. https://codeforces.com/contest/1461/problem/B