How to allocate discrete resource?