const readline = require('readline'); const rl = readline.createInterface({ input: process.stdin, output: process.stdout }); let n, k; let grades = []; rl.question('', (input1) => { [n, k] = input1.split(' ').map(Number); rl.question('', (input2) => { grades = input2.split(' ').map(Number); // for (let i = 0; i < k; i++) { // rl.on("line", function(line){ // const [start, end] = line.split(' ')...