Peru is the name of a single country in South America. The articles 'a' and 'an' are synonymous with 'one', hence the article 'a' is correct for the first sentence. If we use 'the' in place of 'a' it changes the meaning of the sentence, it would then mean that Peru is the only country in South America. This makes options B and C incorrect. In the second sentence, the capital mentioned is the specific capital of Peru. Being a specific definite noun, we use 'the' in the second sentence, and not 'a', making options A and B incorrect and option D is correct.