My code for the problem https://mirror.codeforces.com/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://mirror.codeforces.com/contest/682/submission/127054863