Dependence of electronic and optical properties of multilayer SiC and GeC on stacking sequence and external electric field