-Code
from math import ceil
n, k = map(int, input().split())
for _ in range(k):
s, t, r = map(int, input().split())
read = s * t
res, cnt = 0, 0
while True:
if n - cnt <= read:
res += ceil((n - cnt) / s)
break
cnt += read
res += t + r
print(res)
'Beakjoon&프로그래머스 > 파이썬' 카테고리의 다른 글
[백준/파이썬] 9358번 순열 접기 게임 (0) | 2024.06.07 |
---|---|
[백준/파이썬] 30315번 King's Keep (1) | 2024.06.06 |
[백준/파이썬] 30700번 KOREA 문자열 만들기 (0) | 2024.06.04 |
[백준/파이썬] 31458번 !!초콜릿 중독 주의!! (0) | 2024.06.03 |
[백준/파이썬] 31907번 GIST 찍기 (0) | 2024.06.02 |