The fig above shows the heights of two liquids X and Y when some air…