Hello, kingman!

Boxes A and B are each filled with some sand.

If sand from Box B is poured into Box A until the sand in Box A reaches the brim,

there will be 8 litres of sand left in Box B.

If sand from Box A is poured into Box B until the sand in Box B reaches the brim,

there will be 26 litres of sand left in Box A.

The ratio of the volume of Box A to the volume of Box B is 5:3.

How many more litres of sand are needed to fill both boxes to their brim?

Box A has volume and contains liters of sand.

Box B has volume and contains liters of sand.

Code:

5k
* *
| | 3k
* - - -* * *
|::::::| | |
|::::::| * - - -*
|:: a :| |::::::|
|::::::| |:: b :|
|::::::| |::::::|
*------- *-------
A B

Sand from box B is poured into box A, filling box A.

The amount of sand transferred is: . liters.

Code:

5k
* - - -*
|:5k-a:| ← 3k
* - - -* * *
|::::::| | |
|::::::| | |
|:: a :| | |
|::::::| * - - -*
|::::::| |:: 8 :|
*------- *------*
A B

This leaves: liters in box B.

. . We have: . .[1]

Sand from box A is poured into box B, filling box B.

The amount of sand transferred is: . liters.

Code:

5k
* *
| | 3k
| | * - - -*
| | |:3k-b :
* - - -* * - - -*
|::::::| |::::::|
|::26::| |:: b :|
|::::::| |::::::|
*------- *-------
A B

This leaves liters in box A.

. . We have: . .[2]

Subtract [2] - [1]: .

Substitute into [1]: .

. . The boxes originally contains liters of sand.

The total capacity of the two boxes is: . liters.

Therefore: . liters of sand will fill both boxes.