Weighing plan of bags

This script calculates the number of coins to weigh to find two bags of fake coins.
Two heavier bags : sum,   one heavier and one lighter : dif,   unknown : sum+dif
If at most two fake bags : val.
"-1" looks in decreasing order. List of values to force the beginning of sequence.
sum         dif         val         a[0]        length        -1
values :

 

Home Arithmetic Geometric Misc Topics Scripts Games Exercices Mail Version Française Previous topic Next topic