public double averageNames(int n, int[] personA, int[] personB) {
		boolean[][] table = new boolean[n][n];
		for (int i = 0; i < personA.length; i++) {
			for (int j = 0; j < table[0].length; j++) {
				if (table[personA[i]][j]) {
					table[personB[i]][j] = true;
				}
				if (table[personB[i]][j]) {
					table[personA[i]][j] = true;
				}
			}
			table[personA[i]][personB[i]] = true;
			table[personB[i]][personA[i]] = true;
		}
		int count = 0;
		for (int i = 0; i < table.length; i++) {
			for (int j = 0; j < table[i].length; j++) {
				if (i != j && table[i][j]) {
					count++;
				}
			}
		}
		return (double)count / n;
	}