Impact crater formation in icy layered terrains on Mars