Algorithm
- ๋ฌํฝ์ด๋ ์ฌ๋ผ๊ฐ๊ณ ์ถ๋ค -
๋ฌธ์
๋ ์์ ๋ฌํฝ์ด๊ฐ ์๋ค. ์ด ๋ฌํฝ์ด๋ ๋์ด๊ฐ V๋ฏธํฐ์ธ ๋๋ฌด ๋ง๋๋ฅผ ์ฌ๋ผ๊ฐ ๊ฒ์ด๋ค.
๋ฌํฝ์ด๋ ๋ฎ์ A๋ฏธํฐ ์ฌ๋ผ๊ฐ ์ ์๋ค. ํ์ง๋ง, ๋ฐค์ ์ ์ ์๋ ๋์ B๋ฏธํฐ ๋ฏธ๋๋ฌ์ง๋ค. ๋, ์ ์์ ์ฌ๋ผ๊ฐ ํ์๋ ๋ฏธ๋๋ฌ์ง์ง ์๋๋ค.
๋ฌํฝ์ด๊ฐ ๋๋ฌด ๋ง๋๋ฅผ ๋ชจ๋ ์ฌ๋ผ๊ฐ๋ ค๋ฉด, ๋ฉฐ์น ์ด ๊ฑธ๋ฆฌ๋์ง ๊ตฌํ๋ ํ๋ก๊ทธ๋จ์ ์์ฑํ์์ค.
์ ์ถ๋ ฅ ์์
๋ฌธ์ ํ๊ธฐ
const readline = require("readline");
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
let input;
rl.on("line", function (line) {
input = line
.toString()
.split(" ")
.map((el) => +el);
}).on("close", function () {
console.log(Math.ceil((input[2] - input[1]) / (input[0] - input[1])));
process.exit();
});
๋ฐ์ํ
'๊ฐ์ธ๊ณต๋ถ > Algorithm' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[๋ฐฑ์ค][Node.js] 2884๋ฒ : ์๋ ์๊ณ (0) | 2021.10.05 |
---|---|
[๋ฐฑ์ค][Node.js] 2875๋ฒ : ๋ํ or ์ธํด (0) | 2021.10.04 |
[๋ฐฑ์ค][Node.js] 2864๋ฒ : 5์ 6์ ์ฐจ์ด (0) | 2021.10.02 |
[๋ฐฑ์ค][Node.js] 2845๋ฒ : ํํฐ๊ฐ ๋๋๊ณ ๋ ๋ค (0) | 2021.10.01 |
[๋ฐฑ์ค][Node.js] 2839๋ฒ : ์คํ ๋ฐฐ๋ฌ (0) | 2021.09.30 |
๋๊ธ