I'm making one assumption in this problem...I'm assuming that when the larger cylinder is on the bottom [the natural position ]....the molasses fills all of that cylinder and none of the top cylinder...this would seem to be logical
Let us call the height of the smaller cylinder, h
First....when inverted so that the smaller cylinder is on the bottom, the molasses completely fills the smaller cylinder and the height of molasses that fills the larger cylinder is just (19 + 1/3 - h) = (58/3 - h)
So.....the total volume, V, of the molasses in this position is just
pi (2^2)h + pi (6^2) (58/3 - h) = V
4h * pi + 36pi (58/3 - h) = V
[4h + 36 ( 58/3 - h)] pi = V
[ 4h + 696 - 36h ] pi = V
[696 - 32h] pi = V (1)
And when the can is in its natural position, it fills all of the larger cylinder...so....the volume can be expressed as :
14* 36 * pi = V
504 pi = V (2)
Equate (1) and (2)
504 = 696 - 32h
32h = 192
h = 6 cm = the height of the smaller cylinder
So.... the total height of the can [ under my assumption] = 6cm + 14cm = 20 cm
