Company: Rippling_6aug
Difficulty: medium
Minimize Process Execution Time You are given n processes arranged in positions 1..n . Exactly k of them are high-priority processes, and their distinct 1-based positions are listed in high_priority . For any contiguous segment [l, r] , let length = r-l+1 and let x be the number of high-priority processes inside the segment. You may process the segment directly, or, when its length is greater than 1, split it into two equal contiguous halves and process both halves independently. If x = 0 , direct processing costs normal_time . If x > 0 , direct processing costs priority_time * x * length . Because n is a power of two, every recursive split divides a segment into two equal halves. Find the minimum total time required to process [1,n] . Input Format First line: n k Second line: normal_time priority_time Third line: k distinct 1-based high-priority positions. Output Format Print one 64-bit integer: the minimum total processing time. Constraints 1 <= n <= 10^9 , and n is a power