func_code_string: #include <bits/stdc++.h>   using namespace std;   inline char gc() {     static char buf[1 << 16], *S, *T;     if (S == T) {       T = (S = buf) + fread(buf, 1, 1 << 16, stdin);       if (T == S) return EOF;     }     return *S++;   }   inline long long read() {     long long x = 0, f = 1;     char ch = gc();     while (ch <  0  || ch >  9 ) {       if (ch ==  - ) f = -1;       ch = gc();     }     while (ch >=  0  && ch <=  9 ) x = x * 10 + ch -  0 , ch = gc();     return x * f;   }   int m, k, n, a[1000010], dp[1000010], ans = 0;   long long l;   pair<int, int> c[1000010];   int main() {     m = read();     l = read();     k = read();     n = m * k;     for (int i = 0; i < m; ++i) a[i] = read();     for (int i = 0; i < n; ++i) c[i].first = a[i % m], c[i].second = i;     sort(c, c + n);     long long tot = l / m;     int yu = l % m;     ans = l % 1000000007;     for (int i = 0; i < n; ++i) {       int id = c[i].second;       if (id / m + 1 == 1) {         dp[id / m + 1]++;         continue;       }       dp[id / m + 1] += dp[id / m + 1 - 1], dp[id / m + 1] %= 1000000007;       if (id >= l) continue;       long long cnt = tot - (id / m + 1) + 1;       if (id % m <= yu - 1) cnt++;       ans += cnt % 1000000007 * dp[id / m + 1 - 1] % 1000000007;       ans %= 1000000007;     }     printf( %d n , ans);     return 0;   }   