func_code_string: #include <bits/stdc++.h>   using namespace std;   void OJ() {}   long long n, m, x, k, y;   long long a[200000 + 5], b[200000 + 5];   void imp() { cout << -1 <<   n , exit(0); }   long long remove(long long start, long long end) {     if (start > end) return 0;     long long sz = end - start + 1;     long long maxneb = max(a[start - 1], a[end + 1]);     long long m = *max_element(a + start, a + end + 1);     long long a1 = (sz / k) * x + (sz % k) * y;     if (maxneb > m) return min(a1, y * sz);     if (sz < k) imp();     return min(a1, (sz - k) * y + x);   }   void solve() {     cin >> n >> m >> x >> k >> y;     for (long long i = 1; i <= n; ++i) cin >> a[i];     for (long long i = 1; i <= m; ++i) cin >> b[i];     long long ans = 0;     long long j = 1;     for (long long i = 1; i <= m; ++i) {       long long start = j;       while (j <= n && a[j] != b[i]) j++;       if (j > n) imp();       ans += remove(start, j - 1);       j++;     }     ans += remove(j, n);     cout << ans <<   n ;   }   signed main() {     OJ();     ios::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     solve();   }   