С
Size: a a a
С
AK
AK
С
let sum = 10, n = 10, arr = [];
let max = sum / n, d = max;
for (let i = 0; i < n - 1; i++) {
let x = Math.random() * (max - 0) + 0;
arr.push(x);
max = d + max - x;
}
arr.push(max);
console.log(arr);
console.log(arr.reduce((sum, x) => sum + x, 0));
AK
С
С
AK
AK
С
AK
AK
С
С
С
AK
EN
AK
С
С