func_code_string: #include <bits/stdc++.h>   using namespace std;   long long N, M, a, b, c, t[100007], C, D, S, nn, ans;   char s[100007];   int main() {     scanf( %I64d%I64d%I64d , &N, &C, &D);     for (long long i = 1; i <= N; i++) {       scanf( %d , &t[i]);       scanf( %c%c , &s[i], &s[i]);     }     scanf( %d , &t[N + 1]);     ans = N * D;     S = ans;     for (long long i = N; i >= 1; i--) {       long long l = i, r = i + 1;       while (l > 1 && s[l - 1] == s[l]) l--;       a = min(i - 1, nn);       while (i > l && (t[r] - t[i]) * C < D) {         S = S - D + (t[r] - t[i]) * C;         ans = min(ans, S);         i--;       }       S = S - D + (t[r] - t[l]) * C;       ans = min(ans, S);       i = l;     }     printf( %I64d n , ans);     return 0;   }   