#include <bits/stdc++.h>
using namespace std;
const long long MAX = 1LL << 60;
map<pair<pair<long long, long long>, long long>, long long> dyn;
long long bestway[45][45];
long long n, m;
vector<long long> pricea, priceb;
map<int, vector<vector<long long> > > mem;
void init(int key) {
  if (mem.count(key)) return;
  mem[key] = vector<vector<long long> >(45);
  for (int i = 0; i < 45; i++) mem[key][i].resize(45, -1);
}
long long best(long long count, long long res, long long mn) {
  if (res > n) return MAX;
  assert(res >= mn);
  if (count == 0 && res != 0) return 0;
  if (count == 1) {
    return bestway[res + 20][mn + 20];
  }
  init(count);
  if (mem[count][res + 20][mn + 20] >= 0) return mem[count][res + 20][mn + 20];
  long long left = count / 2;
  long long right = count - left;
  long long choice = MAX;
  for (long long i = mn; i <= n; i++) {
    long long j = res - i;
    if (j < -n) continue;
    long long cand = best(left, i, mn);
    int mn2 = mn - i;
    if (mn2 < -n) mn2 = -n;
    cand += best(right, j, mn2);
    choice = min(choice, cand);
  }
  return mem[count][res + 20][mn + 20] = choice;
}
long long cost = 0, score = 0;
void rec(long long id, long long lowest) {
  if (id == n) {
    bestway[score + 20][lowest + 20] =
        min(bestway[score + 20][lowest + 20], cost);
  } else {
    cost += pricea[id];
    score += 1;
    rec(id + 1, lowest);
    cost -= pricea[id];
    score -= 1;
    if (score > lowest) {
      cost += priceb[id];
      score -= 1;
      rec(id + 1, lowest);
      score += 1;
      cost -= priceb[id];
    }
  }
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < 45; i++)
    for (int j = 0; j < 45; j++) bestway[i][j] = MAX;
  pricea.resize(n);
  priceb.resize(n);
  for (long long i = 0; i < n; i++) cin >> pricea[i];
  for (long long i = 0; i < n; i++) cin >> priceb[i];
  for (int i = -n; i <= 0; i++) rec(0, i);
  cout << best(m, 0, 0) << "\n";
}
