Ternary carbides of the rare earth and iron group metals with CeCoC2- and CeNiC2-type structure