Path integral method by means of generalized coherent states and its numerical approach to molecular systems. I. Ensemble average of total energy