using System;
using System.Linq;
using System.Collections.Generic;

class P
{
    static void Main(string[] _)
    {
        _ = Console.ReadLine().Split(' ');
        int n = int.Parse(_[0]);
        int m = int.Parse(_[1]);
        int[] x = new int[n];
        int[] y = new int[m];

        _ = Console.ReadLine().Split(' ');
        for (int i = 0; i < n; i++)
        {
            x[i] = int.Parse(_[i]);
        }
        _ = Console.ReadLine().Split(' ');
        for (int i = 0; i < m; i++)
        {
            y[i] = int.Parse(_[i]);
        }
        int xx = 0;
        for (int i = 1; i <= n; i++)
        {
            xx += (i - 1) * x[i - 1] - (n - i) * x[i - 1];
        }
        int yy = 0;
        for (int i = 1; i <= m; i++)
        {
            yy += (i - 1) * y[i - 1] - (m - i) * y[i - 1];
        }

        Console.WriteLine(xx * yy);
    }
}
