Optimal prizes in dynamic elimination contests: Theory and