const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); let total = 0; let input = ""; rl.on("line", function (line: string) { if (total === 0) { total = parseInt(line, 10); } else { input = line; } }...