Variational approach to the asymptotic mean-value property for the p-Laplacian on Carnot groups