Explanation
Tank X: 5U <- since tank x to tank y is 5:3 let them be 5u & 3U litres respectively
Tank Y: 3U
5U-3U = 2U -> 26-8=18 -> see model below (worth thousand words

)
[unit][unit][unit][unit][unit][..8..] all the water into tank X
[unit][unit][unit][.........26..........] all the water into tank Y
1U= 18/2 =9
5U =5 x 9 =45 <- vol of tank x we had taken as 5 units
45 + 8 = 53 <- all the water into tank x (see top part of model)
8U = 8 x 9 =72 <- tank x is 5U and tank y is 3U. combined volume is 8U 72 litres
72 - 53 = 19 <- combined X+Y volume less current combined water is the top-up requirement