#include using namespace std; int max(vector A,int i,int j) { int m=A[i]; i++; for(;i<=j;i++) if(A[i]>m) m=A[i]; return m; } int solve(vector A,int n,int f) { // Return the sum of S(S(A)) modulo 10^9+7. int k,j,i,x=0; long long s=0; vectorB(200000); for(k=0;k> n; vector a(n); for(int a_i = 0; a_i < n; a_i++){ cin >> a[a_i]; } int result = solve(a,n,f); cout << result << endl; return 0; }