#include <iostream>
using namespace std;
#define MAXL 1000000
int Order[MAXL + 10], n;
struct node {
int l, r;
int len;
node* left;
node* right;
};
node C[MAXL * 2 + 100];
int c = 0;
int Result[MAXL + 10];
void Build_tr
#include <iostream>
using namespace std;
#define MAXL 1000000
int Order[MAXL + 10], n;
struct node {
int l, r;
int len;
node* left;
node* right;
};
node C[MAXL * 2 + 100];
int c = 0;
int Result[MAXL + 10];
void Build_tr