Seol mar théacs é seo: Optimal resource allocation