Compute-Optimal Test-Time Scaling