Skip to content

marlon307/find_best_box

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Find Best Box 📦


Script para encontrar as melhores caixas focando diminuir o desperdício de espaço vazio e a quantidade de caixas a serem feitas



A função espera dois parâmetro, um volume total e outro uma lista que é o volume máximo suportado por uma caixa

cube_volumes(total_volume: float, boxes: list[int])

Exemplo

boxes = [10, 5, 20, 25, 30, 40, 60, 70, 90, 100, 386]

total_volume = 186
print(cube_volumes(total_volume, boxes), 186)
# retorno [90, 100]

total_volume = 121
print(cube_volumes(total_volume, boxes), 121)
# retorno [25, 100]

total_volume = 116
print(cube_volumes(total_volume, boxes), 116)
# retorno [20, 100]

total_volume = 110
print(cube_volumes(total_volume, boxes), 110)
# retorno [10, 100]

total_volume = 106
print(cube_volumes(total_volume, boxes), 106)
# retorno [10, 100]

total_volume = 386
print(cube_volumes(total_volume, boxes), 386)
# retorno [386]

total_volume = 86
print(cube_volumes(total_volume, boxes), 86)
# retorno [90]

total_volume = 56
print(cube_volumes(total_volume, boxes), 56)
# retorno [60]

total_volume = 12
print(cube_volumes(total_volume, boxes), 12)
# retorno [20]

total_volume = 1.2
print(cube_volumes(total_volume, boxes), 1.2)
# retorno [5]

total_volume = 8
print(cube_volumes(total_volume, boxes), 8)
# retorno [10]

total_volume = 520
print(cube_volumes(total_volume, boxes), 520)
# retorno [386, 5, 30, 100]

total_volume = 564
print(cube_volumes(total_volume, boxes), 564)
# retorno [386, 10, 70, 100]

total_volume = 38
print(cube_volumes(total_volume, boxes), 38)
# retorno [40]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages