The correct options are
A calcium
B magnesium
The hardness of water is due to the presence of calcium and magnesium salts. Hard water contains minerals that form stains on the vessels or pipes they come in contact with. Also, it takes time for hard water to form a lather. Hence it is called hard water.