The problem says: "4 girls went to a party, each one accompanied by their brother. These girls are called $A$, $B$, $C$ and $D$. Their brothers are called, in some specific order, $J$, $K$, $L$ and $M$. From a plate with 38 candies, $A$ took 1, $B$ took 2, $C$ took 3 and $D$ took 4. $J$ took the same number of candies as her sister, $K$ took double the candies, $L$ took the triple and $M$ took the quadruple. The plate was left empty. Determine which is the the brother of each girl."
So far, I found the answer of the problem by this process: let $x_1$, $x_2$, $x_3$ and $x_4$ be the candies taken by $A$, $B$, $C$ and $D$ in no specific order. By this process, $J$, $K$, $L$ and $M$ will be equal to $x_1, 2x_2, 3x_3, 4x_4$ respectively. Then we have:
$38=2x_1+3x_2+4x_3+5x_4$
and
$10=x_1+x_2+x_3+x_4$
From which we get, subtracting the second equation to the first one:
$28=x_1+2x_2+3x_3+4x_4$
Then, $x_4$ can't be equal to 2 or 1:
If $x_4=2$, then $20=3x_3+2x_2+x_1$, which maximum value is $12+6+1=19$, which is lower than $20$.
If $x_4=1$, then $24=3x_3+2x_2+x_1$, which maximum value is $12+6+2=20$, which is lower than $24$.
From here and on I just found myself plugging the possible answers for $x_4=3$ and $x_4=4$, getting the answer with $x_4=3, x_3=4, x_2=1, x_1=2$ (which translates into $J$ being the brother of $B$, $K$ the brother of $A$, $L$ the brother of $D$ and $M$ the brother of $C$).
The problem is that this answer is determined in the end by trial and error, and most of the "solution" is convoluted. This is a problem from a Venezuelan Math Olympiad and the answer is supposed to be 100% logical.
Is there a way to approach this problem in just a logical solution (with no depending on trial and error)?
There's one other thing you can notice by subtracting the $10 = x_1 + x_2 + x_3 + x_4$ equation again. It might have sped up your calculation and made it less frustrating.
You get $18 = x_2 + 2x_3 + 3x_4$. From this, either both $x_2$ and $x_4$ are even, or they are both odd. Combined with your previous observation, this reduces the trial and error to exactly two possibilities. The $x_4 = 4$ option shows itself as incorrect pretty quickly (both $x_2$ and $x_3$ have to be $2$) at which point you only have a single calculation left.