CF52C Circular RMQ

Description

You are given circular array $ a_{0},a_{1},...,a_{n-1} $ . There are two types of operations with it: - $ inc(lf,rg,v) $ — this operation increases each element on the segment $ [lf,rg] $ (inclusively) by $ v $ ; - $ rmq(lf,rg) $ — this operation returns minimal value on the segment $ [lf,rg] $ (inclusively). Assume segments to be circular, so if $ n=5 $ and $ lf=3,rg=1 $ , it means the index sequence: $ 3,4,0,1 $ . Write program to process given sequence of operations.

Input Format

N/A

Output Format

N/A