I have an array a of type int [0,0,0,0,0] of length l
I want to calculate a sum of all elements with odd indexes to use in a downstream constraint, here some "pseudo" MiniZinc code:
s = sum(i in 1..l | i mod 2 == 0) (a[i]);
solve maximize(s);
How can this be done?