<gouthampradhan>math_SquirrelSimulation_1.java
public int minDistance(int height, int width, int[] tree, int[] squirrel, int[][] nuts) {
    int dist = 0;
    for (int[] n : nuts) {
      dist += Math.abs(n[0] - tree[0]) + Math.abs(n[1] - tree[1]);
    }
    dist *= 2;
    int ans = Integer.MAX_VALUE;
    for (int[] n : nuts) {
      int nutDist = Math.abs(n[0] - squirrel[0]) + Math.abs(n[1] - squirrel[1]);
      ans = Math.min(ans, dist - (Math.abs(n[0] - tree[0]) + Math.abs(n[1] - tree[1])) + nutDist);
    }
    return ans;
  }
public int sample_funcname ( int var_0 , int var_1 , int [ ] var_2 , int [ ] var_3 , int [ ] [ ] var_4 ) {
  int var_6 = 0 ;
  for ( int [ ] var_7 : var_4 ) {
    var_6 += Math . abs ( var_7 [ 0 ] - var_2 [ 0 ] ) + Math . abs ( var_7 [ 1 ] - var_2 [ 1 ] ) ;
  }
  var_6 *= 2 ;
  int var_14 = Integer . MAX_VALUE ;
  for ( int [ ] var_7 : var_4 ) {
    int var_15 = Math . abs ( var_7 [ 0 ] - var_3 [ 0 ] ) + Math . abs ( var_7 [ 1 ] - var_3 [ 1 ] ) ;
    var_14 = Math . min ( var_14 , var_6 - ( Math . abs ( var_7 [ 0 ] - var_2 [ 0 ] ) + Math . abs ( var_7 [ 1 ] - var_2 [ 1 ] ) ) + var_15 ) ;
  }
  return var_14 ;
}
