Let the number of animals with hari, jaggu and dinanath be x,y, and z respectively..
Case I : Hari gives six pigs to jaggu and gets one horse, then jaggu wil hav twice that of hari's.
i.e., 2(X-6+1) = Y+6-1
=> 2X-10 = Y+5
=> 2X-Y= 15 ............. eqn (1)
Case II :Dinanath gives fourteen sheeps to hari and gets one horse, then hari wil hav thrice that of dinanth's.
i.e., 3(Z-14+1) = X+14-1
=> 3Z-39 = X+13
=> X-3Z = -52 ..............eqn(2)
Case III: Jaggu gives four cows to dinanath and gets a horse, then dinanath wil have six times that of jaggu's.
i.e., 6(Y-4+1) = Z+4-1
=> 6Y-18 = Z+3
=> 6Y-Z= 21 ................eqn(3)
solving 1 and 2, we get
(1)X2=> 2X+Y= 15
(2) 2X-6Z= -104
(-) (+) (+)
............
-Y+6Z= 119 ................eqn (4)
solving (3) and (4)
(3)x 6=> 36Y- 6Z = 126
(4)=> -Y+ 6Z = 119
..............
35Y = 245
=> Y=7 (jaggu)
sub Y in eqn (1)
2X -7 =15
=> 2X = 22
=> X = 11 (hari)
sub X in eqn (2)
11-3Z= -52
=> -3Z= -63
=> Z= 21 (dinanath)