#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <random>

using namespace std;

#define int long long

int inf = 1000000000;

mt19937 rnd_(12);


vector <vector <int>> g;

int hs(int u , int v) {
    return u*inf+ v;
}

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

    int n , q;
    cin >> n >> q;

    vector <int> a (n);

    for (int i  = 0 ; i < n; i++)
        cin >> a[i];



    for (int i = 0 ; i < q ; i++) {
        int t;
        cin >> t;

        if (t == 2) {
            int l ,  r;
            cin >> l >> r;
            l--;
            r--;

            vector <int> b;


            for (int j = l; j <= r ; j++) {
                b.push_back(a[j]);
            }


            vector <vector <int>> dp0(n+1);

            for (int i = 0 ; i <= n ; i++)
                dp0[i].resize(n+1 , -inf);

            dp0[0][0] =0;

            vector <vector <int>> dp1 = dp0;

            for (int i = 0 ; i < b.size() ; i++) {
                for (int s = 0 ; s <= n; s++) {
                    for (int mx = 0 ;  mx < n ; mx ++) {
                        int s_ = s + b[i];
                        int mx_ = mx;

                        dp1[s][mx] = max(dp0[s][mx] , dp1[s][mx]);
                        if ((s_ >= 0) and (s_ <= n)) {
                            mx_ = max(mx_ , s_);
                            dp1[s_][mx_] = max(dp1[s_][mx_] , dp0[s][mx]+1);
                        }
                    }
                }

                dp0 = dp1;

                for (int s = 0 ; s <= n; s++) {
                    for (int mx = 0 ;  mx <= n ; mx ++) {
                        dp1[s][mx] = 0;
                    }
                }
            }



            int ans = 0;

            for (int i = 0 ; i <= n ; i++)
                ans= max(ans , dp0[i][i]);

            cout << ans << "\n";
        }
        else {
            int ind;
            cin >> ind;

            ind--;
            a[ind] *= -1;
        }
    }

}
