#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int INF = 1000000;
int N, M, A, B;
long long int temp = 0, id = 0, mem, yui = 1, sum = 0;
long long int x[100010], y[100010];
long long int w, h;
bool fir = true;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> N >> M;
  for (int i = 0; i < (N); i++) cin >> x[i];
  for (int i = 0; i < (M); i++) cin >> y[i];
  for (int i = 0; i < (N); i++) {
    w += x[i] * (i - (N - 1) + i);
    { w = w; }
  }
  {}
  for (int i = 0; i < (M); i++) {
    h += y[i] * (i - (M - 1) + i);
    { h = h; }
  }
  {}
  cout << w * h << endl;
}
