title: Sum Manhattan Distances Pairs Points
signature: sum_manhattan_distances_pairs_points <- function(x, y, n) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      toString(actual)==toString(expected)
  }
  
  driver <- function(x, y, n, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(x, y, n), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          list(2L, 4L, 6L, 6L, 8L, 11L, 12L, 13L, 14L, 19L, 20L, 22L, 24L, 28L, 29L, 30L, 32L, 35L, 37L, 44L, 48L, 49L, 51L, 51L, 56L, 59L, 59L, 62L, 65L, 68L, 68L, 68L, 72L, 75L, 77L, 78L, 89L, 89L, 91L, 93L, 95L, 99L), list(6L, 19L, 19L, 22L, 25L, 27L, 31L, 33L, 34L, 35L, 37L, 38L, 38L, 44L, 46L, 50L, 51L, 55L, 58L, 58L, 64L, 64L, 64L, 64L, 65L, 66L, 66L, 66L, 67L, 70L, 75L, 78L, 79L, 81L, 81L, 81L, 82L, 84L, 84L, 86L, 94L, 96L), 37L, 
          35930L
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          list(16L, 76L, 2L, 42L, -24L, -82L, 68L, -2L, 98L, -42L, -72L, 28L, -22L, -52L, 28L, -38L, 36L, 66L, 84L, 64L, -28L, 86L, 52L, 84L, -98L, -30L), list(-34L, 92L, -24L, -62L, 28L, 72L, -10L, 10L, 8L, 90L, -72L, -24L, 50L, -46L, 52L, 58L, 68L, -62L, -64L, -78L, -12L, 24L, 62L, -30L, 62L, -60L), 24L, 
          35216L
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          list(0L, 0L, 0L, 0L, 0L, 1L, 1L, 1L, 1L, 1L), list(0L, 0L, 0L, 0L, 1L, 1L, 1L, 1L, 1L, 1L), 5L, 
          4L
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          list(61L, 37L, 57L, 99L, 22L, 72L, 38L, 85L, 23L, 85L, 15L, 4L, 49L, 9L, 15L, 25L, 7L, 63L, 79L, 6L, 85L, 30L, 12L, 34L, 38L, 6L, 59L, 62L, 59L, 34L, 72L, 97L, 70L, 44L, 95L, 58L, 99L), list(72L, 41L, 77L, 62L, 78L, 36L, 75L, 28L, 91L, 39L, 32L, 56L, 60L, 64L, 21L, 15L, 80L, 85L, 28L, 22L, 53L, 58L, 69L, 62L, 60L, 48L, 66L, 91L, 38L, 66L, 54L, 5L, 24L, 1L, 49L, 71L, 49L), 26L, 
          19322L
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          list(-96L, -86L, -82L, -72L, -72L, -64L, -62L, -60L, -56L, -56L, -56L, -54L, -52L, -40L, -36L, -30L, -10L, 10L, 18L, 26L, 28L, 56L, 56L, 56L, 64L, 90L, 92L, 94L), list(-98L, -98L, -96L, -96L, -82L, -80L, -80L, -68L, -62L, -60L, -46L, -38L, -26L, -26L, -20L, -18L, 16L, 22L, 24L, 26L, 34L, 46L, 52L, 52L, 74L, 76L, 90L, 92L), 26L, 
          42084L
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          list(1L, 0L, 1L, 1L, 1L, 0L, 1L), list(1L, 0L, 1L, 0L, 0L, 1L, 1L), 3L, 
          4L
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          list(6L, 10L, 24L, 25L, 31L, 41L, 43L, 45L, 47L, 65L, 67L, 90L), list(4L, 7L, 11L, 19L, 21L, 39L, 57L, 80L, 84L, 93L, 94L, 97L), 10L, 
          2776L
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          list(-74L, 92L, 34L, 56L, -54L, -98L, -76L, -34L, 16L, 32L, -4L, -16L, 22L, 90L, -52L, -90L, -60L, 70L, -40L, 78L, 96L, -68L, 78L, -56L, -94L), list(14L, 20L, 24L, -92L, 58L, 12L, 78L, 78L, -90L, 96L, -44L, 36L, 30L, -46L, -30L, -80L, 26L, -2L, 26L, 28L, -16L, -50L, -2L, -36L, -8L), 21L, 
          28932L
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          list(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), list(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), 23L, 
          188L
      )))
  
      cat(sprintf("TEST-9...%s\n",driver(
          list(20L, 32L), list(23L, 50L), 1L, 
          0L
      )))
  
  }
  
  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;
  }