For example, 5.6.7.8's shares are 20%, 15%, 30% and 35% respectively.
The weighted average is (5 * 20%+6 *15%+7 * 30%+8 * 35%)/4.