#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;

#define el '\n'
#define ff first
#define ss second
#define pii pair <ll, ll>
#define pb push_back
#define popb pop_back
#define fr(x, l, r) for(ll (x) = l; (x) <= r; (x)++)
#define frb(x, r, l) for(ll (x) = r; (x) >= l; (x)--)

mt19937_64 rnd(time(0));

ll const N = 110;
ll const INF = 1e18 + 100;

void chmax(ll &a, ll b) {
    a = max(a, b);
}

ll n, q;
ll a[N], dp[N][N][N];

ll get(ll l, ll r) {
    ll ans = 0;
    fr(i, l, r) {
        fr(sum, 0, n) {
            fr(pref, 0, sum) {
                if(a[i] == pref)
                    chmax(dp[i][pref][sum], 1);

                if(i > l)
                    chmax(dp[i][pref][sum], dp[i - 1][pref][sum]);

                if(pref - a[i] >= 0 && pref - a[i] <= sum) chmax(dp[i][pref][sum], dp[i - 1][pref - a[i]][sum] + 1);
                if(pref == sum) chmax(ans, dp[i][pref][sum]);
            }
        }
    }

    fr(sum, 0, n)
        fr(pref, 0, sum)
            fr(i, l, r)
                dp[i][pref][sum] = -INF;
    return ans;
}

void solve() {
    cin >> n >> q;
    fr(i, 1, n)
        cin >> a[i];

    fr(sum, 0, n)
        fr(pref, 0, sum)
            fr(i, 0, n)
                dp[i][pref][sum] = -INF;

    while(q--) {
        ll type;
        cin >> type;
        if(type == 1) {
            ll pos;
            cin >> pos;
            a[pos] *= -1;
        }
        else {
            ll l, r;
            cin >> l >> r;
            cout << get(l, r) << el;
        }
    }
}   

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

    int t = 1;
    //cin >> t;
    while(t--)
        solve();
}