#include <bits/stdc++.h>
using namespace std;
int a[20], b[20];
long long mincost[20 + 1][20 + 1 + 20];
int main(int argc, char** argv) {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  for (int i = 0; i < n; i++) scanf("%d", &b[i]);
  const int offd = n;
  for (int ms = 0; ms <= n; ms++)
    for (int d = -n; d <= n; d++) mincost[ms][d + offd] = (1000000000000000LL);
  for (int s = 0; s < (1 << n); s++) {
    int minstart = 0, delta = 0, cost = 0;
    for (int i = 0; i < n; i++)
      if (s & (1 << i)) {
        delta++;
        cost += a[i];
      } else {
        delta--;
        cost += b[i];
        minstart = max(minstart, -delta);
      }
    mincost[minstart][delta + offd] =
        min(mincost[minstart][delta + offd], (long long)cost);
  }
  long long result = (1000000000000000LL);
  const int ms1 = 0;
  for (int d1 = 0; d1 <= n; d1++) {
    long long c1 = mincost[ms1][d1 + offd];
    for (int ms2 = 0; ms2 <= n; ms2++)
      for (int d2 = -n; d2 <= n; d2++) {
        long long c2 = mincost[ms2][d2 + offd];
        int midd = -d1 - d2;
        if (d1 + midd < ms2) continue;
        long long midc = 0;
        int now = 0;
        vector<int> costs;
        for (int i = 0; i < n; i++) {
          midc += a[i] * (m - 2);
          now += m - 2;
          costs.push_back(b[i] - a[i]);
        }
        sort(costs.begin(), costs.end());
        for (int i = 0; i < n; i++) {
          int exc = max(now - midd, 0);
          int change = min(exc / 2, m - 2);
          now -= 2 * change;
          midc += change * costs[i];
        }
        if (now == midd) {
          result = min(result, c1 + midc + c2);
        }
      }
  }
  printf("%d\n", (int)result);
  return 0;
}
