If all swords are produced, you can make 180/2 = 90 sets, and the profit is 90 * 25 = 2250 yuan.
If all knives are produced, you can make 180/4 = 45 sets, and the profit is 45 * 60 = 2700 yuan.
We should make full use of all raw materials and get the maximum profit. Set a spear to make an X set, a sword to make a Y set, a knife to make a Z set, and then
3x+2y+2z = 200 formula 1
X+2y+4z = 180 Formula 2
Profit A = 20x+25Y+60Z Formula 3 has the maximum value.
X-Z= 10