Problem of mathematical logic

hello Nawrot,

Variables with the name “Rst” are all calculation results
The variables are of the integer type
The entries are:

N Solide = Amount of food contained by a plant.
NS Solide = Quantity worn by the character.
MAX N Solide = Maximum quantity that can be worn by the character.

I think that the problem is in my resonance, that it is the logic of calculation which is in question. If I put the results in an index the problem remains, the equation is bad.
But can you please tell me how to relate an array to check the inputs and give the result?