Find the value of k such that the sum of the squares of the roots of the quadratic equation x2−8x+k=0 is 40