I've solved a lot of problems on codeforces, codechef and atcoder. Sorry, not solved, wasted a lot of time. I tried a lot to think logic on problem B of todays contest, but still didn't come up with the solution. I don't know, whether it's a good decision or not, but I'm giving up.