#include<stdio.h> #include<stdlib.h> #include<deque> #include<math.h> using namespace std; struct mypair{ int val; int ind; mypair(int a,int b):val(a),ind(b){} }; int main() { int n, num; scanf("%d %d", &...