You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
509 B
TypeScript
28 lines
509 B
TypeScript
import readline from "node:readline";
|
|
|
|
const rl = readline.createInterface({
|
|
input: process.stdin,
|
|
output: process.stdout,
|
|
});
|
|
|
|
const lines: string[] = [];
|
|
|
|
function solution(
|
|
x1: number,
|
|
y1: number,
|
|
x2: number,
|
|
y2: number,
|
|
sx: number,
|
|
sy: number,
|
|
) {
|
|
console.log({ x1, y1, x2, y2, sx, sy });
|
|
}
|
|
|
|
rl.on("line", (line) => {
|
|
lines.push(line.toString().trim());
|
|
}).on("close", () => {
|
|
const [x1, y1, x2, y2, sx, sy] = lines.map(Number);
|
|
|
|
console.log(solution(x1, y1, x2, y2, sx, sy));
|
|
});
|