#include <bits/stdc++.h>
int main(void) {
  int n, m;
  scanf("%d %d", &n, &m);
  int x[n], y[m];
  int i;
  for (i = 0; i < n; i++) {
    scanf("%d", &x[i]);
  }
  for (i = 0; i < m; i++) {
    scanf("%d", &y[i]);
  }
  int s = 0, t = 0;
  for (i = 0; i < n; i++) {
    s = s + (2 * i - n + 1) * x[i];
  }
  for (i = 0; i < m; i++) {
    t = t + (2 * i - m + 1) * y[i];
  }
  printf("%d", s * t);
  return 0;
}
