Segment Tree for Range Assignment and Range Sum Queries
Given an array of size N filled with all 0s, the task is to answer Q queries, where the queries can be one of the two types: Type 1 (1, L, R, X): Assign value X to all elements on the segment from L to Râ1, andType 2 (2, L, R): Find the sum on the segment from L to Râ1.Examples: Input: N = 5, Q = 3,