#P9275. [AGM 2023 资格赛] DrahSort
[AGM 2023 资格赛] DrahSort
Problem Description
Given a sequence of length , you will receive queries.
- For each query , output the maximum value of the product of two adjacent numbers that are swapped if you perform bubble sort on this interval.
Input Format
The first line contains an integer , representing the number of elements in the array.
The second line contains integers , which are the elements of the array.
The third line contains an integer , representing the number of operations.
Each of the next lines contains a query as described in the statement.
Output Format
Output lines. For each query, output the answer.
10
10 9 8 7 6 5 4 3 2 1
8
1 2
1 3
1 10
9 10
1 4
3 4
2 3
1 4
90
90
90
2
90
56
72
90
Hint
Translated by ChatGPT 5