#include <bits/stdc++.h>
using namespace std;
long long calc(vector<long long> &x) {
  long long sum = 0;
  long long n = x.size();
  for (long long i = 1; i <= n; i++) {
    sum += (n - i) * x[i - 1] - (i - 1) * x[i - 1];
  }
  return sum;
}
int main(void) {
  long long n, m;
  vector<long long> x;
  vector<long long> y;
  cin >> n >> m;
  x.resize(n);
  y.resize(m);
  for (long long i = 0; i < n; i++) cin >> x[i];
  for (long long i = 0; i < m; i++) cin >> y[i];
  cout << calc(x) * calc(y) << endl;
  return 0;
}
