Skip to content

Commit 74c4d0b

Browse files
[BOJ] 34323 할인이 필요해 (B4)
1 parent 43317db commit 74c4d0b

2 files changed

Lines changed: 18 additions & 4 deletions

File tree

서정우/11주차/260310.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
const fs = require("fs");
2+
const filePath =
3+
process.platform === "linux" ? "/dev/stdin" : "./서정우/input.txt";
4+
const input = fs
5+
.readFileSync(filePath)
6+
.toString()
7+
.trim()
8+
.split("\n")
9+
.map((el) => el.trim());
10+
11+
const [N, M, S] = input[0].split(" ").map(Number);
12+
13+
const unmannedPrice = Math.floor(((M + 1) * S * (100 - N)) / 100);
14+
15+
const dealPrice = M * S;
16+
17+
console.log(Math.min(unmannedPrice, dealPrice));

서정우/input.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
3
2-
26 40 83
3-
49 60 57
4-
13 89 99
1+
40 1 100

0 commit comments

Comments
 (0)