5
edits
Changes
m
Changed the algorithm to compile and give correct results
{
int sum;
int i;
if (N == 1) {
l[0] = R;
return;
}
sum = 0;
sum += R - g[i];
for (i = 0; i < N; i++)
l[i] = (sum - (R - g[i]) - (N - 2) * (R - g[i]))/(N - 1);
}
</pre>