Simply calculate your overall average and your average subject.The calculated average consider material coefficients, but also coefficient of each of the recorded marks.