#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
const ll SIZ = ((ll)5e5 + 5), LONGBOI = ((ll)1e17 + 5);
mt19937_64 REALrandom(chrono::system_clock::to_time_t(chrono::system_clock::now()));

ll n, q, l, r, type;
ll a[SIZ], p[SIZ];
ll answer[20][20];

ll getAns(ll l, ll r){
    ll sum, ans = 0;
    for(ll left = l; left <= r; left++){
        for(ll right = left; right <= r; right++){
            sum = 0;
            for(ll i=left; i <= right;i++){
                sum = min(p[i]-p[left-1], p[right]-p[i]);
                if(sum < 0) { break; }
            }
            if(sum < 0) continue;
            ans = max(ans, right - left + (ll)1);
        }
    }
    return ans;
}

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n >> q;
    for(int i=1; i <= n; i++){
        cin >> a[i];
        p[i] = p[i-1]+a[i];
    }

    if(n <= 16){
        for(int i=1; i <= n; i++){
            for(int j=1; j<= n; j++){
                answer[i][j] = getAns(i, j);
            }
        }

        for(int i=1; i<=q;i++){
            cin >> type;
            if(type == 1){ cin >> l; }
            else{
                cin >> l >> r;
                cout << answer[l][r] << endl;
            }
        }
    }
    else{
        for(int i=1; i<=q;i++){
            cin >> type;
            if(type == 1){
                cin >> l;
                a[l] *= (-1);
            }
            else{
                cin >> l >> r;
                cout << getAns(l, r) << endl;
            }
        }
    }

    return 0;
}
