Vanya is in the palace that can be represented as a grid n × m. Each room contains a single chest, an the room located in the i-th row and j-th columns contains the chest of type aij. Each chest of type x ≤ p - 1 contains a key that can open any chest of type x + 1, and all chests of type 1 are not locked. There is exactly one chest of type p and it contains a treasure.

Vanya starts in cell (1, 1) (top left corner). What is the minimum total distance Vanya has to walk in order to get the treasure? Consider the distance between cell (r1, c1) (the cell in the row r1 and column c1) and (r2, c2) is equal to |r1 - r2| + |c1 - c2|.

Input

The first line of the input contains three integers n, m and p (1 ≤ n, m ≤ 300, 1 ≤ p ≤ n·m) — the number of rows and columns in the table representing the palace and the number of different types of the chests, respectively.

Each of the following n lines contains m integers aij (1 ≤ aij ≤ p) — the types of the chests in corresponding rooms. It's guaranteed that for each x from 1 to p there is at least one chest of this type (that is, there exists a pair of r and c, such that arc = x). Also, it's guaranteed that there is exactly one chest of type p.

Output

Print one integer — the minimum possible total distance Vanya has to walk in order to get the treasure from the chest of type p.

Examples

Input

3 4 3
2 1 1 1
1 1 1 1
2 1 1 3


Output

5


Input

3 3 9
1 3 5
8 9 7
4 6 2


Output

22


Input

3 4 12
1 2 3 4
8 7 6 5
9 10 11 12


Output

11
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.ListIterator;
import java.util.PriorityQueue;
import java.util.StringTokenizer;

/** Class: VanyaAndTreasure.java
 *  @author
 *  @version 1.0 <p>
 *  Course:
 *  Written / Updated: Jun 12, 2016
 *
 *  This Class - See VanyaAndTreasure.pdf for instructions.
 *  VERDICT: (most likely correct but not fast enough)
 *  Consider a modified dynamic programming or BFS, or in the alternative
 *  try a tighter heuristic for A*?
 *
 *  UPDATE: Tried a tighter heuristic for A*...
 */
public class VanyaAndTreasure {

	/**
	 * This class describes the room at a certain (x,y) location in the grid.
	 * @author PP
	 *
	 */
	private class Cell implements Comparable<Cell>{
		private int type;	//the chest type (from 1 to p inclusive) that this cell contains.
		private int row, col; 	//row / col index of this room cell.
//		private int distSoFar;	//Distance that Vanya has traveled thus far to get to this cell
//		private int estDistRemaining;	//Est. distance remaining from this cell to the cell containing the final chest (manhattan distance heuristic)
//		private boolean visited;	//Whether a chest in this cell has been visited and unlocked
//		private Cell farthestParent;
//		private Cell farthestNeighbor;
		private int pos1D;
		private int distance;


//		private final int INFINITY = 999999999;

		Cell(int type,int row, int col) {
			this.type = type;
			this.row = row;
			this.col = col;
			this.pos1D = m * row + col;
			this.distance = Integer.MAX_VALUE;
//			this.visited = false;
//			this.distSoFar = INFINITY;
//			this.estDistRemaining = -1;
//			this.farthestParent = null;
//			this.farthestNeighbor = null;
		}

//		private int computeEstDist() {
//			if (this.estDistRemaining != -1)
//				return this.estDistRemaining;
//
//			this.estDistRemaining = VanyaAndTreasure.this.allPairsLongestPath[this.type][VanyaAndTreasure.this.destinationCell.type][this.pos1D];
//			return this.estDistRemaining;
//			if (this == VanyaAndTreasure.this.destinationCell) {
//				this.estDistRemaining = 0;
//				return this.estDistRemaining;
//			}
//
//			Cell currCell = VanyaAndTreasure.this.destinationCell;
//			int tmpEstDist = 0;
//			while (this.type != currCell.type - 1) {
//				Cell farthestParent = currCell.getFarthestParent();
//				tmpEstDist += getDist(farthestParent, currCell);
//				currCell = farthestParent;
//			}
//			tmpEstDist += getDist(this, currCell);
//
//			this.estDistRemaining = tmpEstDist;
//			return this.estDistRemaining;
//		}

//		private Cell getFarthestParent() {
//			if (this.farthestParent != null)
//				return this.farthestParent;
//
////			Cell[] parents = VanyaAndTreasure.this.neighboringCells.get(this.type - 2);
////			if (parents == null) {	//if no neighbors have been initialized yet...
////				parents = getNeighboringCells(this.type - 2);	//invoke custom method
////			}
//			LinkedList<Integer> parents = VanyaAndTreasure.this.chestTypeToRoomLocationsMap.get(this.type - 1);
//
//			int maxDist = -1;
//			int farthestParentLoc1D = -1;
//			for (int parentLoc1D: parents) {
//				int rowParent = parentLoc1D / m;
//				int colParent = parentLoc1D % m;
//				int dist = Math.abs(this.row - rowParent) + Math.abs(this.col - colParent);
//				if (dist > maxDist) {
//					maxDist = dist;
//					farthestParentLoc1D = parentLoc1D;
//				}
//			}
//
//
//			this.farthestParent = roomArr[farthestParentLoc1D / m][farthestParentLoc1D % m];
//			return farthestParent;
//		}

//		private Cell getFarthestNeighbor() {
//			Cell[] neighbors = VanyaAndTreasure.this.neighboringCells.get(this.type);
//			if (neighbors == null) {	//if no neighbors have been initialized yet...
//				neighbors = getNeighboringCells(this.type);	//invoke custom method
//				neighboringCells.put(this.type, neighbors);	//and save it to the hashmap so we don't do same computation twice
//			}
//			int maxDist = -1;
//			Cell farthestNeighbor = null;
//			for (Cell neighbor: neighbors) {
//				int dist = getDist(neighbor, this);
//				if (dist > maxDist) {
//					maxDist = dist;
//					farthestNeighbor = neighbor;
//				}
//			}
//			return farthestNeighbor;
//		}

		@Override
		public String toString() {
			return String.format("(%s, %s) dist: %s", row, col, distance);
		}

		@Override
		public int compareTo(Cell c) {
			// TODO Auto-generated method stub
			return this.distance - c.distance;
		}

//		@Override
//		public int compareTo(Cell c2) {
//			/* The Math.min() is to prevent the total est. distance from going over the INFINITY constant. */
//			return Math.min(this.distSoFar + this.estDistRemaining, INFINITY) - Math.min(c2.distSoFar + c2.estDistRemaining, INFINITY);
////			return (this.distSoFar + this.estDistRemaining) - (c2.distSoFar + c2.estDistRemaining);
//		}
	}
	//end private class Cell

	private class Crawler implements Comparable<Crawler> {
		private int row, col, distance;
		Crawler(int row, int col) {
			this.row = row;
			this.col = col;
			distance = Integer.MAX_VALUE;
		}
		@Override
		public int compareTo(Crawler c) {
			return this.distance - c.distance;
		}
	}

	/*** BEGIN class VanyaAndTreasure ***/
	/* the number of rows and columns in the table representing the palace and
	 * the number of different types of the chests, respectively, where
	 * (1 <= n, m <= 300, and 1 <= p <= n*m) */
	private int n, m, p;

	private Cell[][] roomArr;

//	private int[][] allPairsLongestPath;
	private int[][] shortestDist;

	/* Will map each chest type (from 1 to p, inclusive) to a list of ALL rooms
	 * in which that chest is located.
	 * NOTE: the rooms will be saved in the form of a single integer that represents
	 * the row and column values.
	 *
	 * EXAMPLE: if a chest type 2 is located in rooms (2,3) and (1,0), and
	 * the rooms are in a 4x4 grid, then the hashmap will save the following:
	 * 2: [11, 4]
	 *
	 * where (2,3) is represented as 2*4+3 = 11, and
	 * (1,0) is represented as 1*4+0 = 4.
	 * */
	HashMap<Integer, LinkedList<Integer>> chestTypeToRoomLocationsMap;

	/* Keeps track of ALL neighbors for a particular chest type.
	 * For example, chest type 1 will be mapped to an array of neighboring cells which have chest type 2. */
//	HashMap<Integer, Cell[]> neighboringCells;

//	HashMap<Integer, Cell[]> neighboringCellsAscending;
	Cell[][] neighboringCellsAscending;

	/* The goal destination Cell, which has chest type p (where p is the last integer in a given input problem). */
	Cell destinationCell;

	/**
	 * constructor.
	 */
	public VanyaAndTreasure() {
		try {
			BufferedReader rd = new BufferedReader(new InputStreamReader(System.in));

            //Read the first line
            String line = rd.readLine();

            StringTokenizer tokenizer = new StringTokenizer(line);
            this.n = Integer.parseInt(tokenizer.nextToken());
            this.m = Integer.parseInt(tokenizer.nextToken());
            this.p = Integer.parseInt(tokenizer.nextToken());

            /* Read what this hashmap is all about near the top of this file */
            this.chestTypeToRoomLocationsMap = new HashMap<>();
            this.roomArr = new Cell[n][m];

            /* Read the next n lines. Each line will have m entries. Use these values to
             * create a 2-D array roomArr. */
            for (int i = 0; i < n; i++) {
            	line = rd.readLine();
            	tokenizer = new StringTokenizer(line);
            	for (int j = 0; j < m; j++) {
            		int chestType = Integer.parseInt(tokenizer.nextToken());
            		this.roomArr[i][j] = new Cell(chestType, i, j);	//create new room

            		//Add this room to the hashmap
            		LinkedList<Integer> tempList = chestTypeToRoomLocationsMap.get(chestType);

            		/* if hashmap hasn't yet created the linkedlist associated with this chestType,
            		 * initialize a new linked list, then add the current room to the linkedlist */
    				if (tempList == null) {
    					tempList = new LinkedList<>();
    					chestTypeToRoomLocationsMap.put(chestType, tempList);
    				}
    				tempList.add(i * m + j);	//Add this room to the linkedlist associated with the hashmap

    				/* If the value we read pertains to the final chest type p, then we know
    				 * that this is the ultimate destination, and that there is only ONE chest
    				 * of this type. So let's save this cell for future reference. */
    				if (chestType == this.p) {
    					this.destinationCell = this.roomArr[i][j];
    				}

    				/* If this room contains chest type 1, then we'll initialize the distance between location (0,0)
    				 * and this room's location (since Vanya always starts out at (0,0) and must first find rooms
    				 * with chest type 1, might as well initialize these distances now) */
//    				if (chestType == 1) {
//    					this.roomArr[i][j].distSoFar = (this.roomArr[i][j].row - 0) + (this.roomArr[i][j].col - 0);
//    				}
            	}
            }
            //end for i

//            this.allPairsLongestPath = new int[n*m + 1][n*m + 1];
            this.shortestDist = new int[n][m];
            for (int i = 0; i < shortestDist.length; i++) {
            	Arrays.fill(shortestDist[i], Integer.MAX_VALUE);
            }
//            for (int[] paths: allPairsLongestPath) Arrays.fill(paths, -1);
//            this.neighboringCells = new HashMap<>();
            this.neighboringCellsAscending = new Cell[p][];

//            System.out.println(shortestDist(this.destinationCell));
            System.out.println(shortestDistIterative());

//
//            int gap = 1;
//            while (gap <= p - 1) {
//
//	            for (int i = 1; i <= this.p; i++) {
//	            	LinkedList<Integer> cellsA = chestTypeToRoomLocationsMap.get(i);
//
//	            	int j = i + gap;
//	            	if (j > this.p)
//	            		break;
//	            	LinkedList<Integer> cellsB = chestTypeToRoomLocationsMap.get(j);
//
//	            	int maxDist = -1;
//	            	for (int k: cellsA) {
//	            		int rowA = k / m;
//	            		int colA = k % m;
//	            		for (int l : cellsB) {
//	            			int rowB = l / m;
//	            			int colB = l % m;
//	            			if (gap == 1) {
//	            				this.allPairsLongestPath[i][j][k] = getDist(roomArr[rowA][rowB], roomArr[rowB][colB]);
//	            				continue;
//	            			}
//	            			Cell farthestParentOfB = this.roomArr[rowB][colB].getFarthestParent();
//	            			int rowParent = farthestParentOfB.row;
//	            			int colParent = farthestParentOfB.col;
//
//	            			int currDist = this.allPairsLongestPath[i][j-1][k] + getDist(this.roomArr[rowParent][colParent], this.roomArr[rowB][colB]);
//	            			if (maxDist < currDist) {
//	            				maxDist = currDist;
//	            				this.allPairsLongestPath[i][j][k] = maxDist;
//	            			}
//	            		}
//	            	}
//	            }
//	            gap++;
//            }

            rd.close();
		} catch (IOException ioe) {
			ioe.printStackTrace();
		}
	}

	private int shortestDistIterative() {

		Cell[] cellsWithChestType1 = neighboringCellsAscending[0];
		if (cellsWithChestType1 == null || cellsWithChestType1.length == 0) {	//if no neighbors have been initialized yet...
			cellsWithChestType1 = getNeighboringCells(0, true);	//invoke custom method
			neighboringCellsAscending[0] = cellsWithChestType1;	//and save it to the hashmap so we don't do same computation twice
		}
		for (Cell cellWithChestType1 : cellsWithChestType1) {
//			allPairsLongestPath[0][cellWithChestType1.pos1D] = cellWithChestType1.row + cellWithChestType1.col;
			shortestDist[cellWithChestType1.row][cellWithChestType1.col] = cellWithChestType1.row + cellWithChestType1.col;
			cellWithChestType1.distance = shortestDist[cellWithChestType1.row][cellWithChestType1.col];
		}

		for (int i = 1; i < p; ++i) {
			Cell[] neighbors = neighboringCellsAscending[i];
			if (neighbors == null) {	//if no neighbors have been initialized yet...
				neighbors = getNeighboringCells(i, true);	//invoke custom method
				neighboringCellsAscending[i] = neighbors;	//and save it to the hashmap so we don't do same computation twice
			}

			Cell[] prevNeighbors = neighboringCellsAscending[i - 1];


			if (prevNeighbors.length * neighbors.length >= this.n * this.m * 2) {
				this.bfs2(prevNeighbors, neighbors);
				continue;
			}

			for (Cell neighbor : neighbors) {
				int shortestDistance = Integer.MAX_VALUE;
				int currDist;
				for (Cell prevNeighbor : prevNeighbors) {
					currDist =  shortestDist[prevNeighbor.row][prevNeighbor.col] + getDist(prevNeighbor, neighbor);
//					currDist =  prevNeighbor.distance + getDist(prevNeighbor, neighbor);
					if (currDist < shortestDistance) {
						shortestDistance = currDist;
					}
				}
				shortestDist[neighbor.row][neighbor.col] = shortestDistance;
				neighbor.distance = shortestDist[neighbor.row][neighbor.col];
			}
			//end for Cell neighbor: neighbors
		}
		//end for i
		return shortestDist[this.destinationCell.row][this.destinationCell.col];

	}

	private void bfs2(Cell[] prevNeighbors, Cell[] neighbors) {
		int[][] distance = new int[n][m];
	    for(int i = 0; i < n; i++) for(int j = 0; j < m; j++)
	        distance[i][j] = Integer.MAX_VALUE - 1;

	    for (Cell p : prevNeighbors)
	        distance[p.row][p.col] = shortestDist[p.row][p.col];

	    for (int i = 0; i < n; i++) for (int j = 0; j < m; j++) {
	        if (i+1 < n) distance[i + 1][j] = Math.min(distance[i + 1][j], distance[i][j] + 1);
	        if (j+1 < n) distance[i][j + 1] = Math.min(distance[i][j + 1], distance[i][j] + 1);
	    }

	    for (int i = n-1; i >= 0; i--) for (int j = m-1; j >= 0; j--) {
	        if (i-1 >= 0) distance[i - 1][j] = Math.min(distance[i - 1][j], distance[i][j] + 1);
	        if (j-1 >= 0) distance[i][j - 1] = Math.min(distance[i][j - 1], distance[i][j] + 1);
	    }

	    for (Cell cell : neighbors)
	        shortestDist[cell.row][cell.col] = distance[cell.row][cell.col];
	}

	private void bfs(Cell[] prevNeighbors, Cell[] neighbors) {
//		Arrays.sort(prevNeighbors);

		PriorityQueue<Cell> minPQ = new PriorityQueue<Cell>(Arrays.asList(prevNeighbors));

//		int[][] tmpShortestDist = new int[n][m];
//		for (int[] row : tmpShortestDist) {
//			Arrays.fill(row, Integer.MAX_VALUE);
//		}
		boolean[][] visited = new boolean[n][m];

		for (int i = 0; i < this.n; i++) {
			for (int j = 0; j < this.m; j++) {
				if (this.roomArr[i][j].type == prevNeighbors[0].type) {
					this.roomArr[i][j].distance = this.shortestDist[i][j];
					visited[i][j] = true;
				}
				else {
					this.roomArr[i][j].distance = Integer.MAX_VALUE;
				}
			}
		}

//		for (Cell prev : prevNeighbors) {
//			tmpShortestDist[prev.row][prev.col] = this.shortestDist[prev.row][prev.col];
//		}

//		int currDistance = this.shortestDist[prevNeighbors[0].row][prevNeighbors[0].col];

		int numOfCurrNeighborsVisited = 0;

//		ArrayList<Cell> visited = new ArrayList<>(minPQ);


		while (numOfCurrNeighborsVisited < neighbors.length) {
			Cell currCell = minPQ.remove();
			ArrayList<Cell> bfsNeighbors = getBFSNeighbors(currCell, visited);
			for (Cell bfsNeighbor: bfsNeighbors) {
//				if (visited.contains(bfsNeighbor))
//					continue;
				if (bfsNeighbor.distance > currCell.distance + 1) {
					bfsNeighbor.distance = currCell.distance + 1;
//					minPQ.remove(bfsNeighbor);
					minPQ.add(bfsNeighbor);
					visited[bfsNeighbor.row][bfsNeighbor.col] = true;
					if (bfsNeighbor.type == neighbors[0].type) {
						numOfCurrNeighborsVisited++;
					}
				}

			}
			//end for Cell
		}
		//end while
		for (Cell neighbor : neighbors) {
			this.shortestDist[neighbor.row][neighbor.col] = neighbor.distance;
		}
    }
	//end private void bfs

	private ArrayList<Cell> getBFSNeighbors(Cell currCell, boolean[][] visited) {
		int row = currCell.row;
		int col = currCell.col;
		int maxPossibleNeighbors = 4;
//		if (row - 1 < 0) maxPossibleNeighbors--;
//		if (row + 1 >= this.n) maxPossibleNeighbors--;
//		if (col - 1 < 0) maxPossibleNeighbors--;
//		if (col + 1 >= this.m) maxPossibleNeighbors--;

		ArrayList<Cell> bfsNeighbors = new ArrayList<>();
		int[] rowOffset = {0, 0, 1,-1};
		int[] colOffset = {1,-1, 0, 0};
		for (int i = 0; i < maxPossibleNeighbors; i++) {
			int neighborRow = row + rowOffset[i];
			int neighborCol = col + colOffset[i];
			if (neighborRow < 0 		|| neighborCol < 0 			||
				neighborRow >= this.n 	|| neighborCol >= this.m 	||
				visited[neighborRow][neighborCol] == true) {
				continue;
			}
			Cell bfsNeighbor = this.roomArr[neighborRow][neighborCol];
			bfsNeighbors.add(bfsNeighbor);
		}
		return bfsNeighbors;
	}

//	private int shortestDist(Cell cell) {
//		if (cell.type < 1) throw new RuntimeException();
//		if (allPairsLongestPath[0][cell.pos1D] != -1) {
//			return allPairsLongestPath[0][cell.pos1D];
//		}
//		if (cell.type == 1) {
//			allPairsLongestPath[0][cell.pos1D] = cell.row + cell.col;
//			return allPairsLongestPath[0][cell.pos1D];
//		}
//
//
//		Cell[] neighbors = neighboringCells.get(cell.type);	//get the neighbors from the hashmap above
//		if (neighbors == null) {	//if no neighbors have been initialized yet...
//			neighbors = getNeighboringCells(cell.type, false);	//invoke custom method
//			neighboringCells.put(cell.type, neighbors);	//and save it to the hashmap so we don't do same computation twice
//		}
//
//		int shortestDist = Integer.MAX_VALUE;
//		for (Cell neighbor : neighbors) {
//			int currDistToThisCell = getDist(cell, neighbor) + shortestDist(neighbor);
//			if (currDistToThisCell < shortestDist) {
//				shortestDist = currDistToThisCell;
//			}
//		}
//
//		allPairsLongestPath[0][cell.pos1D] = shortestDist;
//		return allPairsLongestPath[0][cell.pos1D];
//	}

	/**
	 * Method: getNeighboringCells
	 * @param chestType
	 * @return
	 */
	private Cell[] getNeighboringCells(int chestType, boolean ascending) {
		/* All chests of type x - 1 can open chests of type x, so neighboring rooms of type x
		 * contain chests of chestType x - 1. */
		LinkedList<Integer> neighborRooms = this.chestTypeToRoomLocationsMap.get(ascending? chestType + 1 : chestType - 1);
		if (neighborRooms == null) {
			return new Cell[0];
		}
		Cell[] neighbors = new Cell[neighborRooms.size()];
		ListIterator<Integer> iter = neighborRooms.listIterator();
		for (int i = 0; i < neighbors.length; i++) {
			int thisRoom = iter.next();
			int thisRow = thisRoom / this.m;
			int thisCol = thisRoom % this.m;
			neighbors[i] = this.roomArr[thisRow][thisCol];
		}
		return neighbors;
	}

	private int getDist(Cell c1, Cell c2) {
		return Math.abs(c1.row - c2.row) + Math.abs(c1.col - c2.col);
	}

	/**
	 * Method: minTotalDistToGetTreasure
	 * @return the minimum possible total distance Vanya has to walk
	 * in order to get the treasure from the chest of type this.p.
	 */
//	private int minTotalDistToGetTreasure() {
//
//		/* This will save all neighboring cells for a given chest type for easy reference and efficiency. */
////		this.neighboringCells = new HashMap<>();
////
////		/* Might be worth it to try something like A* for this one...
////		 * First set the neighbors of each chest type in all the rooms */
////		for (int i = 0; i < this.roomArr.length; i++) {
////			for (int j = 0; j < this.roomArr[i].length; j++) {
////				Cell thisCell = this.roomArr[i][j];
////				int chestType = thisCell.type;
////
////				//Set all the neighbors
////				Cell[] neighbors = neighboringCells.get(chestType);	//get the neighbors from the hashmap above
////				if (neighbors == null) {	//if no neighbors have been initialized yet...
////					neighbors = getNeighboringCells(chestType);	//invoke custom method
////					neighboringCells.put(chestType, neighbors);	//and save it to the hashmap so we don't do same computation twice
////				}
//////				thisCell.neighborArr = neighbors;	//set the neighbors for this cell
////
////				/* Set the estimated manhattan distance from this cell to destination cell,
////				 * provided that the manhattan distance cannot be shorter than the difference
////				 * between destination chest type and this chest type.
////				 *
////				 * For example, if this cell type == 2 and destination cell type == 5,
////				 * it will take at least 3 unlocking steps to get to the destination chest.
////				 * So, if the manhattan distance between this cell and destination cell is only 2,
////				 * we still have to set the est. distance at 3. */
//////				thisCell.estDistRemaining = Math.max(
//////						this.destinationCell.type - thisCell.type,
//////						Math.abs(this.destinationCell.row - thisCell.row) + Math.abs(this.destinationCell.col - thisCell.col));
////				thisCell.computeEstDist();
////
////			}
////			//end for j
////		}
//		//end for i
//
//		/* Since we start at the upper leftmost corner -- i.e. the location (0,0) -- we'll first get
//		 * the locations of all the rooms with chest type 1 in it (remember, these chest types don't need keys)
//		 * and set them as the initial "neighbors".
//		 *
//		 * We call the below method with parameter 0 (although technically there is no chestType with value 0)
//		 * because doing so will give us an array of all the cells that have chestType 1. */
//
//		Cell[] initialNeighbors = this.getNeighboringCells(0);
//
//		/* Now put these in a prioritylist. Since the Cell objects implement the Comparable interface,
//		 * they will be "sorted" from smallest to largest in the priorityqueue. */
//		PriorityQueue<Cell> pq = new PriorityQueue<>(Arrays.asList(initialNeighbors));
//
//		/* Testing priorityquee */
////		while (!pq.isEmpty()) {
////			System.out.println(pq.remove());
////		}
//
//		Cell currRoom = null;
//
//		/* Begin A* algorithm */
//		HashSet<Cell> openList = new HashSet<>(pq);
//		HashSet<Cell> closedList = new HashSet<>();
//		while (currRoom != this.destinationCell && !pq.isEmpty()) {
//			currRoom = pq.remove();
//			currRoom.visited = true;
//			openList.remove(currRoom);
//			closedList.add(currRoom);
//			Cell[] neighbors = neighboringCells.get(currRoom.type);
//			for (Cell neighbor: neighbors) {
//				if (!neighbor.visited && neighbor.distSoFar > currRoom.distSoFar + this.getDist(currRoom, neighbor)) {
//					neighbor.distSoFar = currRoom.distSoFar + this.getDist(currRoom, neighbor);
//					pq.remove(neighbor);
//					pq.add(neighbor);
//					openList.add(neighbor);
//				}
//			}
//			//end for
//		}
//		//end while
//
//		if (currRoom == this.destinationCell) {
//			return currRoom.distSoFar + currRoom.estDistRemaining;
//		}
//		return -1;
//	}

	public static void main(String[] args) {
		new VanyaAndTreasure();
//		System.out.println(vt.minTotalDistToGetTreasure());
	}
}
