Quantum gravity at Hubble scales determines the cosmological constant and the amplitude of primordial perturbations