function c(s, a) {
  const t = s[0].map((o, r) => ({ prob: o, index: r })).sort((o, r) => r.prob - o.prob);
  let n = 0;
  const e = new Array(t.length).fill(0);
  for (const o of t)
    if (n += o.prob, e[o.index] = o.prob, n >= a)
      break;
  const b = e.reduce((o, r) => o + r, 0);
  return e.map((o) => o / b);
}
export {
  c as default
};
