Necklace

아직 제출이 없습니다시간 제한1초메모리 제한256 MB

문제

Chiaki has nn beautiful gems. The color of the ii-th gem is c_ic\_i and the value is v_iv\_i.

Chiaki would like to choose at least 33 gems and make a necklace such that the adjacent gems must have different color. Formally, let the indices of gems used in the necklace be a_1,a_2,,a_ma\_1,a\_2,\ldots,a\_m (m3m \ge 3) in clockwise order. For each ii (1im1 \le i \le m), c_a_ic\_{a\_i} should be different from c_a_imodm+1c\_{a\_{i \bmod m + 1}}.

Chiaki would like to find a necklace with the maximum possible sum of values: that is, to maximize _i=1mv_a_i\sum\limits\_{i=1}^{m} v\_{a\_i}.

입력

There are multiple test cases. The first line of input contains an integer TT, indicating the number of test cases. For each test case:

The first line contains an integer nn (1n21051 \le n \le 2 \cdot 10^5): the number of gems.

The second line contains nn integers c_1,c_2,,c_nc\_1,c\_2,\ldots,c\_n (1c_in1 \le c\_i \le n) denoting the color of each gem.

The third line contains nn integers v_1,v_2,,v_nv\_1,v\_2,\ldots,v\_n (109v_i109-10^9 \le v\_i \le 10^9) denoting the value of each gem.

It is guaranteed that the sum of nn in all test cases does not exceed 21052 \cdot 10^5.

출력

For each test case, the first line contains an integer mm (m3)m \ge 3): the number of gems in the necklace (note that you don't need to maximize it). The second line contains mm integers a_1,a_2,,a_ma\_1,a\_2,\ldots,a\_m (1a_in1 \le a\_i \le n): the indices of gems used in the necklace in clockwise order. If there are several possible answers, print any one of them.

If Chiaki could not find such a necklace, just output an integer 1-1 on a single line.