My code for the problem https://codeforces.net/problemset/problem/682/D gets a TLE, Please can someone help me in figuring it out the reason? Genrally solutions involve 4D DP but I tried solving it using 3D DP. Thanks in advance. Link to my code- https://codeforces.net/contest/682/submission/127054863