(n,e)-graphs with maximum sum of squares of degrees