Comments

Problem F can also be done using sqrt decomposition.