CF855F Nagini

Description

Nagini, being a horcrux You-know-who created with the murder of Bertha Jorkins, has accumulated its army of snakes and is launching an attack on Hogwarts school. Hogwarts' entrance can be imagined as a straight line (x-axis) from $ 1 $ to $ 10^{5} $ . Nagini is launching various snakes at the Hogwarts entrance. Each snake lands parallel to the entrance, covering a segment at a distance $ k $ from $ x=l $ to $ x=r $ . Formally, each snake can be imagined as being a line segment between points $ (l,k) $ and $ (r,k) $ . Note that $ k $ can be both positive and negative, but not $ 0 $ . Let, at some $ x $ -coordinate $ x=i $ , there be snakes at point $ (i,y_{1}) $ and point $ (i,y_{2}) $ , such that $ y_{1}>0 $ and $ y_{2}<0 $ . Then, if for any point $ (i,y_{3}) $ containing a snake such that $ y_{3}>0 $ , $ y_{1}

Input Format

First line of input contains a single integer $ q $ ( $ 1

Output Format

Output the answer for each query of type 2 in a separate line.

Explanation/Hint

In the first sample case, the danger value for $ x $ -coordinates $ 1 $ is $ 0 $ as there is no $ y_{2} $ satisfying the above condition for $ x=1 $ . Danger values for $ x $ -coordinates $ 2 $ and $ 3 $ is $ 10+|-7|=17 $ . Danger values for $ x $ -coordinates $ 4 $ to $ 9 $ is again $ 0 $ as there is no $ y_{2} $ satisfying the above condition for these coordinates. Thus, total danger value is $ 17+17=34 $ .