#include <bits/stdc++.h>
using namespace std;
const int N = 30;
const int inf = 0x3f3f3f3f;
int n, a[N], b[N], m, sum[N], c[N];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  for (int i = 1; i <= n; ++i) scanf("%d", &b[i]);
  for (int i = 1; i <= n; ++i) {
    sum[i] = sum[i - 1] + a[i];
    a[i] = b[i] - a[i];
  }
  a[0] = a[n];
  int ans = m * sum[n];
  int maxn = a[1] + 10, e;
  for (int i = 2, j = 2; i < n * m; ++i, ++j) {
    if (j >= n) j -= n;
    e = a[j] + 10;
    c[e]++;
    if (e > maxn) maxn = e;
    ++i;
    ++j;
    if (j >= n) j -= n;
    e = a[j] + 10;
    c[e]++;
    if (e > maxn) maxn = e;
    for (int j = maxn;; --j)
      if (c[j]) {
        --c[j];
        maxn = j;
        break;
      }
  }
  ++c[a[n] + 10];
  for (int i = 1; i < 20; ++i) ans += c[i] * (i - 10);
  printf("%d\n", ans);
  return 0;
}
