title: Sum Manhattan Distances Pairs Points
signature: fun sumManhattanDistancesPairsPoints(x: ArrayList<Int>, y: ArrayList<Int>, n: Int): Int {
test_code: package main
  
  import kotlin.text.*
  import kotlin.math.*
  
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  fun validateSolution(actual:Int, expected:Int):Boolean{
    return actual.equals(expected)
  }
  fun driver(x: ArrayList<Int>, y: ArrayList<Int>, n: Int, expected:Int):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(x, y, n), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver(arrayListOf(2, 4, 6, 6, 8, 11, 12, 13, 14, 19, 20, 22, 24, 28, 29, 30, 32, 35, 37, 44, 48, 49, 51, 51, 56, 59, 59, 62, 65, 68, 68, 68, 72, 75, 77, 78, 89, 89, 91, 93, 95, 99), arrayListOf(6, 19, 19, 22, 25, 27, 31, 33, 34, 35, 37, 38, 38, 44, 46, 50, 51, 55, 58, 58, 64, 64, 64, 64, 65, 66, 66, 66, 67, 70, 75, 78, 79, 81, 81, 81, 82, 84, 84, 86, 94, 96), 37, 35930)
      println("TEST-0...${result}")
      
      result = driver(arrayListOf(16, 76, 2, 42, -24, -82, 68, -2, 98, -42, -72, 28, -22, -52, 28, -38, 36, 66, 84, 64, -28, 86, 52, 84, -98, -30), arrayListOf(-34, 92, -24, -62, 28, 72, -10, 10, 8, 90, -72, -24, 50, -46, 52, 58, 68, -62, -64, -78, -12, 24, 62, -30, 62, -60), 24, 35216)
      println("TEST-1...${result}")
      
      result = driver(arrayListOf(0, 0, 0, 0, 0, 1, 1, 1, 1, 1), arrayListOf(0, 0, 0, 0, 1, 1, 1, 1, 1, 1), 5, 4)
      println("TEST-2...${result}")
      
      result = driver(arrayListOf(61, 37, 57, 99, 22, 72, 38, 85, 23, 85, 15, 4, 49, 9, 15, 25, 7, 63, 79, 6, 85, 30, 12, 34, 38, 6, 59, 62, 59, 34, 72, 97, 70, 44, 95, 58, 99), arrayListOf(72, 41, 77, 62, 78, 36, 75, 28, 91, 39, 32, 56, 60, 64, 21, 15, 80, 85, 28, 22, 53, 58, 69, 62, 60, 48, 66, 91, 38, 66, 54, 5, 24, 1, 49, 71, 49), 26, 19322)
      println("TEST-3...${result}")
      
      result = driver(arrayListOf(-96, -86, -82, -72, -72, -64, -62, -60, -56, -56, -56, -54, -52, -40, -36, -30, -10, 10, 18, 26, 28, 56, 56, 56, 64, 90, 92, 94), arrayListOf(-98, -98, -96, -96, -82, -80, -80, -68, -62, -60, -46, -38, -26, -26, -20, -18, 16, 22, 24, 26, 34, 46, 52, 52, 74, 76, 90, 92), 26, 42084)
      println("TEST-4...${result}")
      
      result = driver(arrayListOf(1, 0, 1, 1, 1, 0, 1), arrayListOf(1, 0, 1, 0, 0, 1, 1), 3, 4)
      println("TEST-5...${result}")
      
      result = driver(arrayListOf(6, 10, 24, 25, 31, 41, 43, 45, 47, 65, 67, 90), arrayListOf(4, 7, 11, 19, 21, 39, 57, 80, 84, 93, 94, 97), 10, 2776)
      println("TEST-6...${result}")
      
      result = driver(arrayListOf(-74, 92, 34, 56, -54, -98, -76, -34, 16, 32, -4, -16, 22, 90, -52, -90, -60, 70, -40, 78, 96, -68, 78, -56, -94), arrayListOf(14, 20, 24, -92, 58, 12, 78, 78, -90, 96, -44, 36, 30, -46, -30, -80, 26, -2, 26, 28, -16, -50, -2, -36, -8), 21, 28932)
      println("TEST-7...${result}")
      
      result = driver(arrayListOf(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), arrayListOf(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), 23, 188)
      println("TEST-8...${result}")
      
      result = driver(arrayListOf(20, 32), arrayListOf(23, 50), 1, 0)
      println("TEST-9...${result}")
      
          
  }
  
  main()
source_py: def sum_manhattan_distances_pairs_points(x, y, n):
      sum = 0
      for i in range(n):
          for j in range((i + 1), n):
              sum += (abs((x[i] - x[j])) + abs((y[i] - y[j])))
      return sum
source_cpp: int sum_manhattan_distances_pairs_points(vector<int> x, vector<int> y, int n) {
    int sum = 0;
    for ( int i = 0;
    i < n;
    i ++ ) for ( int j = i + 1;
    j < n;
    j ++ ) sum += ( abs ( x [ i ] - x [ j ] ) + abs ( y [ i ] - y [ j ] ) );
    return sum;
  }