Understanding the Role of Training Data in Test-Time Scaling