알고리즘/Python
[백준/Python] 13458번 : 시험 감독
_SIHA_
2022. 3. 30. 17:14
📖 문제 링크
https://www.acmicpc.net/problem/13458
13458번: 시험 감독
첫째 줄에 시험장의 개수 N(1 ≤ N ≤ 1,000,000)이 주어진다. 둘째 줄에는 각 시험장에 있는 응시자의 수 Ai (1 ≤ Ai ≤ 1,000,000)가 주어진다. 셋째 줄에는 B와 C가 주어진다. (1 ≤ B, C ≤ 1,000,000)
www.acmicpc.net
✅ 최종 코드
def solution(n, person, b, c):
count = 0
for i in range(n):
temp = person[i] - b
count += 1
if temp>0:
count += temp // c
if temp % c:
count+=1
return count
n = int(input())
person = list(map(int, input().split()))
b, c = map(int, input().split())
print(solution(n, person, b, c))