Consider the first value v1 unable to form with exisitng denos, because we can deal with only 1 new demos, instead of potential multiple ones if we think about largest first.

Reductio ad absurdum + variation: we know that the deno we need to introduce <= v1, so let us introduce new denom with value v1, and see by how much we can reduce v1, and the relationship BETWEEN possible answers

now if new deno d < v1 =>

 c1 * (v1 - delta) + v2 (v2 < v1) = c1 * v1 + v2 - c1 * delta

Since v2 < v1, if we introduce d, we might as well introduce v1, because it is more powerful,i.e., we will always be greedy and introduce the first gap value as denom!

Catches:

1.we know we need 1 as base value
2.need to cast int durng multiply into unsigned long long to handle overflow