First-principles study of the structural, elastic, and electronic properties of C20, C12B8, and C12N8