본문 바로가기
python-algorithm

백준 26566 Pizza

by 무적김두칠 2022. 12. 24.

https://www.acmicpc.net/problem/26566

 

26566번: Pizza

There’s a pizza store which serves pizza in two sizes: either a pizza slice, with area A1 and price P1, or a circular pizza, with radius R1 and price P2. You want to maximize the amount of pizza you get per dollar. Should you pick the pizza slice or the

www.acmicpc.net

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
def sol(a1, p1, r1, p2):
    pi = 3.141592
    slice = a1/p1
    whole = (pi*r1**2)/p2
    if slice > whole:
        return 'Slice of pizza'
    else:
        return 'Whole pizza'
 
if __name__ == '__main__':
    n =  int(input())
    for _ in range(n):
        a1, p1 = map(int,input().split())
        r1, p2 = map(int, input().split())
        print(sol(a1, p1, r1, p2))
 
cs
반응형

'python-algorithm' 카테고리의 다른 글

백준 26768 H4x0r  (0) 2022.12.26
백준 26530 Shipping  (0) 2022.12.26
백준 26731 Zagubiona litera  (0) 2022.12.24
백준 26532 Acres  (0) 2022.12.24
백준 26500 Absolutely  (0) 2022.12.24

댓글