Let cost of 1 buffalo=x
let cost of 2nd buffalo=y
Cost + gains=20,000
x+5/100x=20,000
21/20x=20,000
x=4,00,000/21
Cost - loss =20,000
x-1/10y=20,000
9/10y=20,000
y=2,00,000/9
overall gain or loss= `(4,00,000)/21*5/100-(2,00,000)/9*10/100`
=20,000/21=20,000/9
=-1269.84
He is in loss of 1269.84 Rs.