~~~~~↵
↵
You are given array a of n integers. You need to split the array into 2 arrays (one of which may be empty) such that sum of product of these 2 arrays is maximum.↵
Formally, you need to find l such that sum of a1⋅a2⋅⋯⋅al and al+1⋅al+2⋅⋯⋅an is maximum over all valid choices for l.↵
Note that an empty array has a product of 0.↵
~~~~~↵
↵
↵
~~~~~↵
↵
Print the maximum sum of product of the arrays mod 1e9+7.↵
~~~~~↵
↵
↵
~~~~~↵
↵
1≤n≤1e5 , 1≤|ai|≤1e9↵
~~~~~↵
↵
↵
↵
~~~~~↵
I tried to solve this problem by pre-calculating prefix product and suffix product modulo M(1e9+7) and taking the maximum among every i (1<=i<=n).
Thanks in Advance. ↵
~~~~~↵
↵