Problem 2281 · Hard
Sum minimum strength times total strength over every contiguous group modulo 1000000007.
Open the interactive visualisation