Variational characterizations of the total scalar curvature and eigenvalues of the Laplacian