func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 1e5 + 11, mod = 1e9 + 7;   const double EPS = 1e-7;   const int INF = 2e9;   const int base = 500;   const int dx[] = {1, -1, 0, 0};   const int dy[] = {0, 0, 1, -1};   int m, t, r, w[333], ans;   bool ct[333 + base + 11];   int main() {     if (fopen( string                 .in ,                r ))       freopen(            string             .in ,            r , stdin),           freopen(                string                 .out ,                w , stdout);     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     cin >> m >> t >> r;     for (int i = 1; i <= m; ++i) {       cin >> w[i];     }     for (int i = 1; i <= m; ++i) {       int candles = 0;       for (int j = w[i] - 1; j >= w[i] - t; --j) {         candles += ct[j + base];       }       if (candles < r) {         for (int j = w[i] - 1; j >= w[i] - t; --j) {           if (!ct[j + base] && candles < r) {             ct[j + base] = 1;             ++ans;             ++candles;           }         }         if (candles < r) {           return cout << -1, 0;         }       }     }     cout << ans;     return 0;   }   