public static void calculate(int x, int y) {

		Queue<Node> cola = new LinkedList<Node>();
		cola.add(new Node(x, y, 0));

		for (int i = 0; i < v.length; i++) {
			for (int j = 0; j < v[0].length; j++) {
				v[i][j] = false;
			}
		}
		v[x][y] = true;
		dp[x][y][x][y] = 0;

		while (!cola.isEmpty()) {
			Node actually = cola.poll();
			for (int i = 0; i < pX.length; i++) {
				if (actually.i + pX[i] >= 0 && actually.i + pX[i] < arr.length
						&& actually.j + pY[i] >= 0
						&& actually.j + pY[i] < arr[0].length
						&& v[actually.i + pX[i]][actually.j + pY[i]] == false) {
					v[actually.i + pX[i]][actually.j + pY[i]] = true;
					dp[x][y][actually.i + pX[i]][actually.j + pY[i]] = actually.value + 1;
					cola.add(new Node(actually.i + pX[i], actually.j + pY[i],
							actually.value + 1));
				}
			}
		}

	}