Dynamical evolution of galaxy clusters in the framework of the N-body problem. The formation of supermassive cD galaxies