let buf = '' process.stdin.on('readable', () => { let chunk = process.stdin.read() if (chunk) buf += chunk.toString() }) let n let cost = [] let dp = [] process.stdin.on('end', () => { buf.split('\n').forEach((line, i) => { if (i === 0) n ...