Berger inequality for Riemannian manifolds with an upper sectional curvature bound