I hope you understand that the "mean" of n numbers is the sum of those number divided by n so that the sum of the numbers is n times that mean.
If "the mean of n numbers is p" then the sum of the n numbers is np. If the mean of two numbers is q then the sum of those two numbers is 2q. If the mean of the remaining n- 2 numbers is 10 then the sum of those remaining numbers is 10(n-2).
Of course, the sum of those two numbers and the remaining n-2 number is the sum of all n numbers: np= 2q+ 10(n- 2).