Pressure-induced the formation of Mg(CH3)2 and Ca(CH3)2 studied by the first principles