Megaflooding on Earth and Mars