Evaluation and rank of web pages is a hot topic for many internet companies and researchers. PageRank is a link analysis tool and it assigns a numerical weighting to each element of a hyperlinked set of documents, such as the World Wide Web, with the purpose of "measuring" its relative importance within the set. The algorithm may be applied to any collection of entities with reciprocal quotations and references. The numerical weight that it assigns to any given element E is referred to as the PageRank of E and denoted by . Other factors like Author Rank can contribute to the importance of an entity.

For simplicity, in this problem PageRank vector q is defined as q = Gq, Where , S is the destination-by-source stochastic matrix, U is all one matrix, n is the number of nodes and α is the weight between 0 and 1 (here we use 0.85).

For the example on the right, we have:

Denote the current PageRank vector and the next PageRank vector by q^{cur} and q^{next} respectively. The process is to compute the iterative powering for finding the first eigenvector.

The computation ends until for some small ε(10^{-10}).

For simplicity, in this problem PageRank vector q is defined as q = Gq, Where , S is the destination-by-source stochastic matrix, U is all one matrix, n is the number of nodes and α is the weight between 0 and 1 (here we use 0.85).

For the example on the right, we have:

Denote the current PageRank vector and the next PageRank vector by q

The computation ends until for some small ε(10

The input contains many test cases.

For each case, there are multiple lines. The first line contains an integer N(N<=3000), which represents the number of pages. Then a N*N zero-one matrix follows. The element E_{ij} (0 <= i, j < N) on the matrix represents whether the i-th page has a hyper link to the j-th page.

For each case, there are multiple lines. The first line contains an integer N(N<=3000), which represents the number of pages. Then a N*N zero-one matrix follows. The element E

提交代码