Alvin owns a farm with 3 cows, 20 chickens, and 12 ducks while Tom owns a farm with 2 cows, 2 goats, and 12 ducks. Alvin's total income in a week is RM700 and Tom earns RM900 a day. Then Alvin's wife had an affair with Tom's wife and Alvin beat the outta Tom in a bar that is 3km away from their farms. How much is the average cost to pay for Alvin and Tom's settlement and what is X?​