#include <bits/stdc++.h>
#define x first
#define y second
#define LL long long
#define PII pair<int, int>
using namespace std;
const int N = 510;
int n, l, m;
PII a[N];
LL f[N][N];
int main() {
scanf("%d%d%d", &n, &l, &m);
memset(f, 0x3f, sizeof f);
for (int i = 1; i <= n; i ++ ) scanf("%d", &a[i].x);
for (int i = 1; i <= n; i ++ ) scanf("%d", &a[i].y);
a[n + 1].x = l, a[n + 1].y = 0;
f[1][0] = 0;
for (int i = 2; i <= n + 1; i ++ ) {
for (int j = 0; j <= m; j ++ ) {
for (int p = i - 1; p >= 0; p -- ) {
int num = j - (i - p - 1);
if (num >= 0)
f[i][j] = min(f[i][j], f[p][num] + (a[i].x - a[p].x) * a[p].y);
}
}
}
LL res = 0x3f3f3f3f3f3f3f3f;
for (int i = 0; i <= m; i ++ ) res = min(res, f[n + 1][i]);
printf("%lld\n", res);
return 0;
}
相关文章
- 10-09ListView Optimization
- 10-09Optimization on content service with local search in cloud of clouds
- 10-09Qin Shi Huang's National Road System HDU - 4081
- 10-09HDU4081 Qin Shi Huang's National Road System(次小生成树)
- 10-09VK Cup 2016 - Qualification Round 2 C. Road Improvement dfs
- 10-09论文笔记系列-Speeding Up Automatic Hyperparameter Optimization of Deep Neural Networks by Extrapolation of
- 10-09Combinatorial optimization and reasoning with graph neural networks 翻译
- 10-09CAE-ADMM--Implicit Bitrate Optimization Via Admm-based Pruning In Compressive Autoencoders
- 10-09「Computer Vision」Note on Anchor Box Optimization
- 10-09webpack.optimize.CommonsChunkPlugin has been removed, please use config.optimization.splitChunks in