You know, you cannot random pick the numbers in their allowed ranges. For instance, you cannot choose
a=0
, because then no pair of
{b,c}
values could fullfill the requirement
a + b + c = 85
You can however, freely random pick
a
in the
[25,40]
range.
Once you've got
a
, you may random pick
b
in its current allowed range
[85-15-a, 45]
(once again, if
b < (85-15-a)
then no value of
c
would be good for obtaining
a+b+c=85
).
Finally you compute
c = 85-a-b
.