IT/Baekjoon Oline Judge
[BOJ] 19532번 - 수학은 비대면강의입니다
개발자희망생고롸파덕
2024. 1. 9. 17:43
사용언어 : javascript - node.js
#문제
#제출코드
const fs = require('fs');
const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt';
const input = fs
.readFileSync(filePath)
.toString()
.split(' ')
.map((item) => +item);
solution(input[0], input[1], input[2], input[3], input[4], input[5]);
function solution(a, b, c, d, e, f) {
for (let i = -999; i <= 999; i++) {
for (let j = -999; j <= 999; j++) {
if (a * i + b * j === c && d * i + e * j === f) {
console.log(i, j);
return;
}
}
}
}