Distribute Remaining Input Percent among n-inputs in JavaScript I am trying to make a function for the following situation: