1 solutions

  • 0
    @ 2024-10-16 15:47:11
    #include <bits/stdc++.h>
    using namespace std;
    const int N = 1e6 + 7;
    typedef long long ll;
    ll a[N], b[N], c[N], d[N];
    int n, m, k, x, s;
    int main() {
    	ios::sync_with_stdio(false);
    	cin.tie(0);
    	cout.tie(0);
    	cin >> n >> m >> k >> x >> s;
    	for (int i = 0; i < m; ++i)
    		cin >> a[i];
    	for (int i = 0; i < m; ++i)
    		cin >> b[i];
    	for (int i = 1; i <= k; ++i)
    		cin >> c[i];
    	for (int i = 1; i <= k; ++i)
    		cin >> d[i];
    	int tmp = upper_bound(d + 1, d + k + 1, s) - d;
    	ll ans = (n - c[tmp - 1]) * x;
    	for (int i = 0; i < m; ++i)
    		if (b[i] <= s) {
    			tmp = upper_bound(d + 1, d + k + 1, s - b[i]) - d;
    			ans = min(ans, (n - c[tmp - 1]) * a[i]);
    		}
    	cout << ans << endl;
    	return 0;
    }
    
    
    • 1

    Information

    ID
    1530
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    10
    Tags
    # Submissions
    40
    Accepted
    1
    Uploaded By