From 06ab8ec60132ed9fcef9ec7678aa29d4639db623 Mon Sep 17 00:00:00 2001 From: heerucan Date: Mon, 11 Apr 2022 12:59:04 +0900 Subject: [PATCH] [BOJ] 11047 (#1) --- BOJ/11047.py | 16 ++++++++++++++++ .../CH4 \352\265\254\355\230\204/11047.py" | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 BOJ/11047.py create mode 100644 "CodingTest/CH4 \352\265\254\355\230\204/11047.py" diff --git a/BOJ/11047.py b/BOJ/11047.py new file mode 100644 index 0000000..68455d6 --- /dev/null +++ b/BOJ/11047.py @@ -0,0 +1,16 @@ +n, k = list(map(int, input().split())) + +coin = [] +result = 0 +for i in range(n): + coin.append(int(input())) + +coin.sort(reverse=True) + +for i in range(len(coin)): + result += k // coin[i] + k = k % coin[i] + +print(result) + + diff --git "a/CodingTest/CH4 \352\265\254\355\230\204/11047.py" "b/CodingTest/CH4 \352\265\254\355\230\204/11047.py" new file mode 100644 index 0000000..68455d6 --- /dev/null +++ "b/CodingTest/CH4 \352\265\254\355\230\204/11047.py" @@ -0,0 +1,16 @@ +n, k = list(map(int, input().split())) + +coin = [] +result = 0 +for i in range(n): + coin.append(int(input())) + +coin.sort(reverse=True) + +for i in range(len(coin)): + result += k // coin[i] + k = k % coin[i] + +print(result) + +