Search⌘ K
AI Features

Minimum Space Wasted from Packaging

Minimum Space Wasted from Packaging asks you to assign every package a fitting box from one supplier, minimize total unused space, and return it modulo a large prime or -1 if impossible.

Statement

You have n packages that need to be placed into boxes, with one package per box. There are m suppliers, and each supplier offers boxes of ...