len=int(log(y-x+1.0)/log(2.0)); printf("%d\n",max(stmax[x][len],stmax[y-d[len]+1][len])); printf("%d\n",min(stmin[x][len],stmin[y-d[len]+1][len])); } } int main(){ int n, q; scanf("%d%d",&n,&q); init(n); rmq(q); system("pause"); return 0...