SV Constraint using array of weights

Hi all,
Is there a cleaner way to code it to make it more general rather than hard coding it.
Problem:
var can have values between 0-95 but rate at which we see a random value from 0-31, 32-63, and 64-95 is decided by weight array in following manner:
weight_arr = '{2,3,4};
constraint rate_c
{
var dist{[0:31]:/weight_arr[0],[32:63]:/weight_arr[1],[64:95]:/weight_arr[2]};
}

Problem is that range might increase in future, so I don’t want it to hard-code it.

Thanks

In reply to navjeet1503:

Two ideas that might help:

https://verificationacademy.com/forums/systemverilog/help-distriution-constraint-variable-have-value-within-array-values-weights-another-array#reply-56293

https://verificationacademy.com/forums/systemverilog/distributed-weightage-constraint#reply-46525

Thanks Dave.