I recommend looking at these problems #368, #311 and #122 before moving onto this problem.
Like in those problems, we can try to guess our return value. If we pick some "sweetness value" and amount of splits required for it are more than allowed, this means that it's too low and we need to reduce it to split more. If the number of splits is too high or equal, we can try a higher value. We can easily utilize binary searching for this.
Resolves: #217
Algorithm:
I recommend looking at these problems #368, #311 and #122 before moving onto this problem. Like in those problems, we can try to guess our return value. If we pick some "sweetness value" and amount of splits required for it are more than allowed, this means that it's too low and we need to reduce it to split more. If the number of splits is too high or equal, we can try a higher value. We can easily utilize binary searching for this.