Optimal allocation of policy limits in layer reinsurance treaties