Definition: The task is to generate the correct answer for a given math problem.
Input: Problem: 8 years ago , p was half of q ' s age . if the ratio of their present ages is 3 : 4 what will be the total of their present ages ?
