2。 Let a be x, then b is 40-X.
12%x+ 14%(40-x)=5
Solution x = 30
Then Party A gets a loan of 300,000 yuan and Party B gets 654.38+10,000 yuan.