Pātuhitia tēnei: Optimal resource allocation