본문 바로가기
Beakjoon&프로그래머스/파이썬

[백준/파이썬]6779번 Who Has Seen The Wind

by 현장 2021. 4. 22.

-코드

h = int(input())
m = int(input())

for t in range(1, m + 1):
    r = -6 * (t ** 4) + h * (t ** 3) + 2 * (t ** 2) + t
    if r <= 0:
        print(f"The balloon first touches ground at hour: {t}")
        break
if r > 0:
    print("The balloon does not touch ground in the given time.")