#include using namespace std; #define int long long #define rep(i,n) for(int (i)=0;(i)<(n);(i)++) #define rrep(i,n) for(int (i)=((n)-1);(i)>=0;(i)--) #define itn int #define all(x) (x).begin(),(x).end() #define F first #define S second const long long INF = 1LL << 60; const int MOD = 1000000007; struct SegTree{ int n; vector > node; SegTree(vector v){ int sz = v.size(); n = 1; while(n=0;i--) node[i] = min(node[2*i+1], node[2*i+2]); } int getnum(int p){ return node[n-1+p].F; } int geti(int p){ return node[n-1+p].S; } void update(int number, int val){ number += n-1; node[number].F= val; while(number>0){ number=(number-1)/2; node[number] = min(node[number*2+1], node[number*2+2]); } } pair getmin(int a, int b, int k=0, int l = 0, int r = -1){ if(r<0) r=n; if(r<=a||b<=l) return {INF,INF}; if(a <= l&& r<=b) return node[k]; pair vl = getmin(a, b, 2*k+1, l, (l+r)/2); pair vr = getmin(a, b, 2*k+2, (l+r)/2, r); return min(vl, vr); } void showall(){ for(int i=0;i<2*n-1;i++)cout<>n>>q; vector a(n); rep(i,n) cin>>a[i]; SegTree t(a); //t.showall(); rep(i, q){ int b,l,r; cin>>b>>l>>r; l--; r--; if(b==1){ int tmpl = t.getnum(l), tmpr = t.getnum(r); //cout<