#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
const int MAXN = 100005;
const int MAXV = 1000010;
inline long long gcd(long long n1, long long n2) {
  return n2 == 0 ? abs(n1) : gcd(n2, n1 % n2);
}
int a[100], b[100], c[100];
map<int, int> mmap;
long long solve(int remain, int t) {
  mmap.clear();
  for (int i = -22; i < 23; ++i) mmap[i] = INF;
  for (int i = 0; i < 1 << t; ++i) {
    int menor = 0, tmp = 0;
    int soma = 0;
    for (int j = 0; j < t; ++j) {
      if ((1 << j) & i) {
        soma += c[j];
        tmp++;
      } else {
        tmp--;
      }
      menor = min(menor, tmp);
    }
    if (menor != tmp && menor < 0) continue;
    mmap[tmp] = min(mmap[tmp], soma);
  }
  long long best = INF;
  for (int i = remain; i < 22; ++i) {
    best = min((long long)(mmap[i] + mmap[-i]), best);
  }
  return best;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  while (cin >> n >> m) {
    for (int i = 0; i < n; ++i) cin >> a[i];
    for (int i = 0; i < n; ++i) cin >> b[i];
    for (int i = 0; i < n; ++i) c[i] = a[i] - b[i];
    long long sum = 0;
    for (int i = 0; i < n; ++i) sum += b[i];
    sum *= m;
    vector<pair<int, int> > vec;
    for (int i = 0; i < n; ++i) vec.push_back(pair<int, int>(c[i], i));
    sort(vec.begin(), vec.end());
    if (n & 1) {
      vector<int> todos(2 * n, 0);
      long long aux = 0;
      for (int i = 0; i < n / 2; ++i) {
        todos[vec[i].second] = 1;
        todos[vec[i].second + n] = 1;
        aux += 2 * vec[i].first;
      }
      aux += vec[n / 2].first;
      sum += aux * (m - 2) / 2;
      int tmp, menor;
      todos[vec[n / 2].second] = 1;
      todos[vec[n / 2].second + n] = 0;
      tmp = 0, menor = 0;
      for (int i = 0; i < n; ++i) {
        tmp += (todos[i] ? 1 : -1);
        menor = min(tmp, menor);
      }
      menor *= -1;
      sum += solve(menor, n);
    } else {
      vector<int> todos(n, 0);
      long long aux = 0;
      for (int i = 0; i < n / 2; ++i) {
        todos[vec[i].second] = 1;
        aux += vec[i].first;
      }
      sum += aux * (m - 2);
      int tmp = 0, menor = 0;
      for (int i = 0; i < n; ++i) {
        tmp += (todos[i] ? 1 : -1);
        menor = min(tmp, menor);
      }
      menor *= -1;
      sum += solve(menor, n);
    }
    cout << sum << endl;
  }
}
