Ammonium dicyanamide as a precursor for the synthesis of metal nitride and carbide nanoparticles