-Code
for _ in range(int(input())):
res = set()
idx = 1
total, oil, food = map(int, input().split())
while True:
oil_mile = oil * idx
food_mile = food * idx
if oil_mile > total and food_mile > total:
break
if oil_mile < total:
res.add(oil_mile)
if food_mile < total:
res.add(food_mile)
idx += 1
print(total, oil, food)
print(len(res))
'Beakjoon&프로그래머스 > 파이썬' 카테고리의 다른 글
[백준/파이썬] 32587번 Dragged-out Duel (0) | 2024.11.02 |
---|---|
[백준/파이썬] 32604번 Jumbled Scoreboards (0) | 2024.11.01 |
[백준/파이썬] 32305번 Farmers’ Market (1) | 2024.10.30 |
[백준/파이썬] 32585번 Building Pyramids (1) | 2024.10.29 |
[백준/파이썬] 8387번 Dyslexia (0) | 2024.10.28 |