Google Interview Question

An array is given. Find the sum of elements in every possible substring.