How to use Top-down DP?
Help me by providing a top-down dp solution for these two: first, second.
If there are any type of optimizations that manages it to run in 1s please elaborate.
Colin X Sam X Shayan | Easy Problems Duel | NAC Warmup #1
Codeforces Round 946 Solution Discussion