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

[백준/파이썬] 5163번 Isn’t It Funny How a Bear Likes Honey?

by 현장 2024. 5. 18.

-Code

from math import pi

for t in range(1, int(input()) + 1):
    b, w = map(float, input().split())
    total = 0
    for _ in range(int(b)):
        total += (4 / 3) * pi * (float(input()) ** 3) / 1000

    print(f"Data Set {t}:")
    print("Yes" if w <= total else "No")
    print()