{"trustable":false,"sections":[{"title":"Đề","value":{"format":"PLAIN","content":"Cho dãy A có N phần tử.\nCó N hàm. Hàm thứ i sẽ trả về tổng các A_j với L_i \u003c\u003d j \u003c\u003d R_i.\nGiải quyết Q truy vấn sau:\nCó 2 dạng:\n1 x y: thay A_x \u003d y\n2 x y: In ra tổng các hàm thứ x đến hàm thứ y."}},{"title":"Input","value":{"format":"PLAIN","content":"N\nA_1 ... A_N\nL_1 R_1\n...\nL_N R_N\nQ\nt_1 x_1 y_1\n...\nt_Q x_Q y_Q"}},{"title":"Output","value":{"format":"PLAIN","content":"Với mỗi truy vấn loại 2 in ra kết quả"}},{"title":"Giới hạn","value":{"format":"PLAIN","content":"N, Q \u003c\u003d 10^5\nA_i, y \u003c\u003d 10^9\n\nSubtask 1:\nN \u003c\u003d 1000, Q \u003c\u003d 1000\nSubtask 2:\nRi - Li \u003c\u003d 10\nTất cả x đều phân biệt\nSubtask 3:\nKhông có ràng buộc nào thêm"}},{"title":"Examples","value":{"format":"PLAIN","content":"Example Input\n5\n1 2 3 4 5\n1 3\n2 5\n4 5\n3 5\n1 2\n4\n2 1 4\n1 3 7\n2 1 4\n2 3 5\nExample Output\n41\n53\n28"}}]}