( 1+50%)x * 0.9+( 1+40%)(500-x)* 0.9 = 500+ 157
1.35 x+630- 1.26 x = 657
0.09x=27
x=300
500-300=200 yuan
A: The cost of A is 300 yuan, and the cost of B is 200 yuan.