for (let j = 0; j < k; ++j) {
            m[j] = Math.min(m[j], m[j + vi] + wi);
        }