Help needed on a CSES DP problem "Coding Company"

Does anyone know how to tackle with this problem?
Coding Company https://cses.fi/problemset/task/1665/

Any hint will be appreciated.
Thanks.

1 Like

You can look for the solution here.