#include <bits/stdc++.h>
using namespace std;
int main() {
  int H, W, t, T1, m;
  cin >> H >> W;
  int array1[W];
  int array2[W];
  int array3[W];
  T1 = 0;
  m = 0;
  for (int i = 0; i < W; i++) {
    cin >> array1[i];
    T1 = T1 + array1[i];
  }
  for (int i = 0; i < W; i++) {
    cin >> array2[i];
  }
  for (int y = 0; y < W; y++) {
    if (y == 0) {
      array3[y] = T1 + array2[W - 1];
    } else {
      array3[y] = T1 + array2[W - 1] +
                  (array2[W - y - 1] + array2[W - 2]) * y / 2 -
                  (array1[W - y] + array1[W - 1]) * y / 2;
    }
  }
  for (int i = 0; i < W; i++) {
    if (array3[i] > m) {
      m = array3[i];
    }
  }
  cout << m << endl;
  return 0;
}
