Multidimensional Gaussian sums