You are given a sequence of length and a number . A number is special if there exists a contiguous subarray that contains exactly numbers that are strictly greater than . The specialty of a sequence is the sum of special numbers that are available in the sequence. Your task is to determine the specialty of the provided sequence.
Input format
Constraints
for all array indices
The beauty will be .
For , subsequence is
For , subsequence is
For , subsequence is
For there do not exist such subsequences.