@sruthesanju , Do you mean such a case could not occur where even the total sum of the Value column would be less than the Input value ?
We are trying to understand what would be the failing cases and what needs to be done for such cases ? Also, The Scenarios you have mentioned, all Output as the Input Value itself.
What is the End Output required ? Just a Comparison ?