美团8.13笔试
第一题 魔法外卖,有没有老哥帮我看看为啥只过了 55% 啊,想不通啊!
const t = Number(read_line().split(' ')[1]);
const arr = read_line().split(' ').map(Number).sort((a, b) => a - b);
// x 正常送次数,y 魔法送次数
let x = 0, y = 0;
for (let i = 0; i < arr.length; ++i) {
if (arr[i] < t * (x + 1)) ++y;
else ++x;
}
console.log(y); 
