A necessary and sufficient condition for the star decomposition of complete graphs