BOJ - 1166 - 선물

Updated:

import sys

def solution():
    N, L, W, H = map(int, sys.stdin.readline().split())

    left = 0
    right = max(L, max(W, H))

    for i in range(10000):
        mid = (left + right) / 2

        if(L // mid) * (W // mid) * (H // mid) >= N:
            left = mid
        else:
            right = mid
    print("%0.10f"%(right))

solution()

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

Categories:

Updated:

Leave a comment