Codeforces Round 410 (Div. 2)
D
Mike and distribution
Codeforces
2400
原题
← CE →
翻译中…

Mike has always been thinking about the harshness of social inequality. He's so obsessed with it that sometimes it even affects him while solving problems. At the moment, Mike has two sequences of positive integers $*A* = [*a*_{1}, *a*_{2}, ..., *a*_{*n*}]$ and $*B* = [*b*_{1}, *b*_{2}, ..., *b*_{*n*}]$ of length $*n*$ each which he uses to ask people some quite peculiar questions.

翻译中…

To test you on how good are you at spotting inequality in life, he wants you to find an "unfair" subset of the original sequence. To be more precise, he wants you to select $*k*$ numbers $*P* = [*p*_{1}, *p*_{2}, ..., *p*_{*k*}]$ such that $1 ≤ *p*_{*i*} ≤ *n*$ for $1 ≤ *i* ≤ *k*$ and elements in $*P*$ are distinct. Sequence $*P*$ will represent indices of elements that you'll select from both sequences. He calls such a subset $*P*$ "unfair" if and only if the following conditions are satisfied: $2·(*a*_{*p*_{1}} + ... + *a*_{*p*_{*k*}})$ is greater than the sum of all elements from sequence $*A*$, and $2·(*b*_{*p*_{1}} + ... + *b*_{*p*_{*k*}})$ is greater than the sum of all elements from the sequence $*B*$. Also, $*k*$ should be smaller or equal to image because it will be to easy to find sequence $*P*$ if he allowed you to select too many elements!

翻译中…

Mike guarantees you that a solution will always exist given the conditions described above, so please help him satisfy his curiosity!

翻译中…

Input

翻译中…

The first line contains integer $*n*$ ($1 ≤ *n* ≤ 10^{5}$) — the number of elements in the sequences.

翻译中…

On the second line there are $*n*$ space-separated integers $*a*_{1}, ..., *a*_{*n*}$ ($1 ≤ *a*_{*i*} ≤ 10^{9}$) — elements of sequence $*A*$.

翻译中…

On the third line there are also $*n*$ space-separated integers $*b*_{1}, ..., *b*_{*n*}$ ($1 ≤ *b*_{*i*} ≤ 10^{9}$) — elements of sequence $*B*$.

翻译中…

Output

翻译中…

On the first line output an integer $*k*$ which represents the size of the found subset. $*k*$ should be less or equal to image.

翻译中…

On the next line print $*k*$ integers $*p*_{1}, *p*_{2}, ..., *p*_{*k*}$ ($1 ≤ *p*_{*i*} ≤ *n*$) — the elements of sequence $*P*$. You can print the numbers in any order you want. Elements in sequence $*P*$ should be distinct.

翻译中…

样例

Input #1
5
8 7 4 8 3
4 2 5 3 7
Output #1
3
1 4 5
InputCopy OutputCopy
题目信息
题号
798D
时间限制
2 s
内存限制
256 MB
标签
构造
排序

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。