I would like to know if there exists a closed form formula to the following recurrence:
- $f(s, 0) = 1$
- $f(s,b) = \displaystyle\sum_{i=1}^{min(s, b)} \left[ (s-i+1)\times f(i, b-i) \right] $
This recurrence gives the solution to problem F of the ICPC Latin American regionals of 2019.
The problem itself can be solved in $O(n^2)$ by using dynamic programming and keeping a matrix of precomputed sums. I'm just curious about if there is some technique that allows obtaining a closed formula to recurrences like this, so I can solve it in better runtime complexity.