HDU - 6098:Inversion(暴力均攤)
Now we want to know B i =max i∤j A j Bi=maxi∤jAj , i≥2 i≥2 .
InputThe first line of the input gives the number of test cases T; T test cases follow.
Each case begins with one line with one integer n : the size of array A.
Next one line contains n integers, separated by space, ith number is
Limits
T≤20 T≤20
2≤n≤100000 2≤n≤100000
1≤Ai≤1000000000 1≤Ai≤1000000000
∑n≤700000 ∑n≤700000 OutputFor each test case output one line contains n-1 integers, separated by space, ith number is