Submit solution
Points:
7 (partial)
Time limit:
1.0s
Memory limit:
64M
Author:
Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig
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 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?
Constraints
For all subtasks, .
Subtask 1 [10%]
Subtask 2 [10%]
Subtask 3 [80%]
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
Comments
Try using 64 bit integers if you're getting WA on everything except for the test case.