There is not just one solution to this problem. If you know the mark obtained in one test then you can calculate the mark required in the othe test to give the overall target grade.
You work out the relationship as follows:
Let x = mark out of 100 in the first test
Let y = mark out of 100 in the second test
Now 40% of x + 40% of y = 60
or 40x/100 + 60y/100 = 60
multiply throughout by 100
40x + 60y = 6000
4x + 6y = 600
2x + 3y = 300
Rearranging
x = (300 - 3y)/2
or
y = (300 - 2x)/3
Example sets of solutions:
x = 0, y = 100
x = 75, y = 50