Let's say that the value invested in the account with a rate of 8% is "x", then the amount invested in the account with a rate of 12% is:
To calculate the total interest we need to calculate the interest of each individual account and sum them:
The total interest is the sum of the two expressions above:
The value invested in the account with 8% interest is 830, the one invested in the account with 12% interest is 1280.