Is it possible to do “combination sum I” with 2d DP?

All the solutions for this problem:

https://cses.fi/problemset/task/1635

are 1D. I struggled to find a 2D DP solution to optimize to 1D instead go jumping straight to 1D.