## DMPG '18 S2 - Mimi and K-uteness

View as PDF

Points: 7 (partial)
Time limit: 1.0s
Memory limit: 64M

Author:
Problem type

Mimi decides to play a game with the following rules:

A -subarray is a subarray of length .

The -uteness of an array is defined as the sum of all -subarrays of .

The winner is the person who can output the -uteness of for , where is the number of elements in . Can you beat Mimi?

#### Input Specification

The first line of input will contain a single integer, .
The next line of input will contain space separated integers, .

#### Output Specification

lines, with the line being the -uteness of the array.

#### Sample Input

5
1 1 1 1 1

#### Sample Output

5
8
9
8
5