The correct answer is A. To hit the target.
To hit the nail on the head means to do something exactly right. It is often used in the context of solving a problem or making a decision. For example, if you are trying to figure out how to fix a broken machine, you might say, "I think I've hit the nail on the head!" This means that you have figured out the solution to the problem.
The other options are not correct. B, to catch someone napping, means to surprise someone when they are not paying attention. C, to guess right, means to make a correct guess. D, to settle the old score, means to resolve a conflict or disagreement.