long long dp[N][N][5]; // 0 - new comp on far left/far right, 1 - new comp otherwise, 2 - used to merge 2 comps, 3 - added on far left/far right, 4 - added otherwise ...
Some results have been hidden because they may be inaccessible to you
Show inaccessible results