https://alandroidnet.com/related/Dynamic Programming optimal allocation resources