#D12957. Divide Cake into Five

    ID: 10775 Type: Default 1000ms 268MiB

Divide Cake into Five

Divide Cake into Five

Divide Cake into Five

Segtree is a quintuplet tutor. Today is Christmas Eve, so I'm trying to divide the round cake into five equal parts for the quintuplets.

The cake is divided into N N pieces from the center in a fan shape, i i th and i+1 i + 1 th (1 leqi leqN1 1 \ leq i \ leq N -1 ), N N th and 1 1 The second piece is next to each other.

The size of the i i th piece is Ai A_i . If the sum of the sizes of all the pieces is S S , then S S is guaranteed to be a multiple of 5 5 for all inputs.

Given a non-negative integer Y Y . How to divide a cake into quintuplets that meet the following conditions is called "cake quintet".

  • Everyone takes one or more pieces.
  • The pieces each take in the cake are connected. In other words, when the pieces are grouped by the taker, there is no set of pieces in the same group that cannot be reached repeatedly by moving to the same group and adjacent pieces.
  • There is no piece that no one takes.
  • For everyone, if the size of the piece to be taken is X X , it always satisfies X+Y geqS/5 X + Y \ geq S / 5 .

Find out how many different ways to divide the cake so that it becomes "five equal parts of the cake".

input

Input is given from standard input in the following format.

N N Y Y A1 A_1 A2 A_2  ldots \ ldots AN A_N

output

Please output the number according to how to divide the cake so that it becomes "five equal parts of the cake".

However, insert a line break at the end.

Constraint

  • 5 leqN leq300 5 \ leq N \ leq 300
  • 1 leqAi leq109 1 \ leq A_i \ leq 10 ^ 9
  • 0 leqY leq109 0 \ leq Y \ leq 10 ^ 9
  • All inputs are integers.

Input example 1

5 0 1 1 1 1 1

Output example 1

1

Input example 2

10 27 3 1 4 1 5 9 2 6 5 4

Output example 2

252

Example

Input

5 0 1 1 1 1 1

Output

1

inputFormat

inputs.

Given a non-negative integer Y Y . How to divide a cake into quintuplets that meet the following conditions is called "cake quintet".

  • Everyone takes one or more pieces.
  • The pieces each take in the cake are connected. In other words, when the pieces are grouped by the taker, there is no set of pieces in the same group that cannot be reached repeatedly by moving to the same group and adjacent pieces.
  • There is no piece that no one takes.
  • For everyone, if the size of the piece to be taken is X X , it always satisfies X+Y geqS/5 X + Y \ geq S / 5 .

Find out how many different ways to divide the cake so that it becomes "five equal parts of the cake".

input

Input is given from standard input in the following format.

N N Y Y A1 A_1 A2 A_2  ldots \ ldots AN A_N

outputFormat

output

Please output the number according to how to divide the cake so that it becomes "five equal parts of the cake".

However, insert a line break at the end.

Constraint

  • 5 leqN leq300 5 \ leq N \ leq 300
  • 1 leqAi leq109 1 \ leq A_i \ leq 10 ^ 9
  • 0 leqY leq109 0 \ leq Y \ leq 10 ^ 9
  • All inputs are integers.

Input example 1

5 0 1 1 1 1 1

Output example 1

1

Input example 2

10 27 3 1 4 1 5 9 2 6 5 4

Output example 2

252

Example

Input

5 0 1 1 1 1 1

Output

1

样例

5 0
1 1 1 1 1
1