#include #include #define rep(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++) using namespace atcoder; using namespace std; typedef long long ll; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n, q; cin >> n >> q; segtree st(n); rep(i, 0, n) { ll x; cin >> x; st.set(i, x); } while (q--) { int t; cin >> t; if (t == 1) { int x, y; cin >> x >> y; st.set(x, y); } else { int x, y; cin >> x >> y; cout << st.prod(x, y) << '\n'; } } }