﻿namespace topCoder
{
	using System;
	using System.Collections.Generic;

	class SumOfPower
	{
		public int findSum(int[] array)
		{
			int c = 0;
			int n = array.Length;

			for (int l = 1; l <= n; l++)
			{
				for (int i = 0; i <= n - l; i++)
				{
					for (int j = i; j < i + l; j++)
					{
						c += array[j];
					}
				}
			}

			return c;
		}
	}
}
