#P9277. [AGM 2023 资格赛] 反转
[AGM 2023 资格赛] 反转
Problem Description
Given a sequence of length , where every number is less than . You need to perform exactly operations. In each operation, you flip one binary bit of one number. In the end, you need to make
as large as possible, where is the bitwise XOR operation.
Input Format
The first line contains integers , , . It is guaranteed that , , .
The next line contains integers, the sequence . For all , it is guaranteed that .
Output Format
Output lines. Each line contains two integers and , satisfying , , meaning that you flip the -th bit of the number . That is, .
You may flip the same bit multiple times. If there are multiple solutions that maximize the total sum, output any one of them.
2 5 1
0 31
1 0
4 2 2
0 0 2 2
4 0
3 0
5 6 4
63 15 0 10 5
5 5
4 5
4 4
5 4
Hint
Translated by ChatGPT 5