Compute Optimal Scaling of Skills: Knowledge vs Reasoning