#include <bits/stdc++.h>
using namespace std;
int N;
int open[30], clos[30];
int dp1[30][30];
int dp2[30][30];
int diff[30];
long long func(long long M, long long cnt) {
  int i;
  long long ans = 0;
  for ((i) = 0; (i) < (int)(N); (i)++) {
    long long tmp = min(cnt, M);
    cnt -= tmp;
    ans += diff[i] * tmp;
  }
  for ((i) = 0; (i) < (int)(N); (i)++) ans += M * clos[i];
  return ans;
}
int main(void) {
  int M, i, j;
  cin >> N >> M;
  for ((i) = 0; (i) < (int)(N); (i)++) cin >> open[i];
  for ((i) = 0; (i) < (int)(N); (i)++) cin >> clos[i];
  for ((i) = 0; (i) < (int)(N); (i)++) diff[i] = open[i] - clos[i];
  sort(diff, diff + N);
  for ((i) = 0; (i) < (int)(N + 1); (i)++)
    for ((j) = 0; (j) < (int)(N + 1); (j)++) dp1[i][j] = dp2[i][j] = (1 << 29);
  dp1[0][0] = 0;
  for ((i) = 0; (i) < (int)(N); (i)++)
    for ((j) = 0; (j) < (int)(N + 1); (j)++)
      if (dp1[i][j] != (1 << 29)) {
        dp1[i + 1][j + 1] = min(dp1[i + 1][j + 1], dp1[i][j] + open[i]);
        if (j > 0)
          dp1[i + 1][j - 1] = min(dp1[i + 1][j - 1], dp1[i][j] + clos[i]);
      }
  dp2[N][0] = 0;
  for (i = N; i > 0; i--)
    for ((j) = 0; (j) < (int)(N + 1); (j)++)
      if (dp2[i][j] != (1 << 29)) {
        dp2[i - 1][j + 1] = min(dp2[i - 1][j + 1], dp2[i][j] + clos[i - 1]);
        if (j > 0)
          dp2[i - 1][j - 1] = min(dp2[i - 1][j - 1], dp2[i][j] + open[i - 1]);
      }
  long long ans = (1ll << 60);
  for ((i) = 0; (i) < (int)(N + 1); (i)++)
    for ((j) = 0; (j) < (int)(N + 1); (j)++)
      if (dp1[N][i] != (1 << 29) && dp2[0][j] != (1 << 29)) {
        long long tmp = dp1[N][i] + dp2[0][j];
        int cnt_open = N * M / 2;
        cnt_open -= (N + i) / 2;
        cnt_open -= (N - j) / 2;
        if (cnt_open >= 0 && cnt_open <= N * (M - 2)) {
          tmp += func(M - 2, cnt_open);
          ans = min(ans, tmp);
        }
      }
  cout << ans << endl;
  return 0;
}
