Constraint for row total with each element in the array less than a given value

In reply to Yuankun:

Hello Yuankun, thank you for your reply. I was wondering if it would be possible to use only one constraint. Because I see some examples that use multiple conditions within one constraint.

Also, if instead of sum of row, I want to keep sum of column as 100, can I change i to j in the lines
constraint def{foreach(array[i]){
array[i].sum(item) with (int’(item))==100;}}