#include #include using namespace std; const int N = 100005; const int M = 1000000007; int a[N], h[N], p[N], sum[N], e[N], cnt[N]; void solve() { int n; scanf("%d", &n); for (int i=0; i