Need help with Educational Codeforces Round 133 C and D
I am getting TLE for C and D. Any hints ?
My Submission for C My Submission for D