Bathing Mr. 01011
On a cool evening, Mr. **01011** wanted to take a bath in his tank filled with a liquid of density **ρ**. However, the liquid was too cold for bathing. To make the most of his time in the magical tank, which is divided into **N** compartments with varying densities, Mr. **01011** decided to conduct experiments with floating bodies in the tank. The temperature of the liquids in the tank does not affect these bodies. Each body is a regular cube with a specific density and edge length, equipped with a device that can instantly adjust its volume. When placed in a tank, part of the body will be submerged, and you need to determine the volume of this submerged part.
Each experiment involves the following actions:
- Place the body in a specific tank (**INS**) - Remove the body from a specific tank (**DEL**) - Attach a body of the same density with volume **Y** to a specific body in a tank (**INC**) - Cut off a part of a specific body in a tank with volume **Y** (**DEC**) - Calculate the total submerged volume of bodies in tanks from **L** to **R**, and return the sum of all submerged volumes (**CALC**).
All processes occur at constant temperature and pressure.
Input
The input begins with an integer **N** (**N** ≤ **10^5**), representing the number of tanks. The next **N** lines provide the density of the liquid in each tank **ρ_i** in kg/m³ (1 ≤ **ρ_i** ≤ 20000, real number). The following line contains the integer **Q** (**Q** ≤ **10^5**), the number of experiments. Each of the next **Q** lines contains one of the following formats:
- **INS X Y Z**: where **X** is the tank number (integer), **Y** is the density of the body (1 ≤ **Y** ≤ 20000, real number, in kg/m³), and **Z** is the edge length of the cube (1 ≤ **Z** ≤ 1000, real number, in meters). - **DEL X**: where **X** (integer) is the serial number of the cube to be removed. Ignore this command if the cube hasn't been placed in any tank. - **INC X Y**: where **X** (integer) is the serial number of the cube to increase in volume, and **Y** (1 ≤ **Y** ≤ 10^9, real number, in m³) is the volume increase. Ignore this command if the cube hasn't been placed in a tank or has been removed. - **DEC X Y**: where **X** (integer) is the serial number of the cube to decrease in volume, and **Y** (1 ≤ **Y** ≤ 10^9, real number, in m³) is the volume decrease. Ignore this command if the cube hasn't been placed in a tank or has been removed. If the body has less volume than **Y**, consider it as having zero mass and volume. - **CALC L R**: where **L**, **R** (1 ≤ **L**, **R** ≤ **N**) are integers. Calculate the total submerged volume of bodies in tanks numbered from **L** to **R**.
Each tank can accommodate the liquid without overflowing when bodies are submerged. Bodies are assigned serial numbers starting from 1 in the order they appear in **INS** queries.
Output
After each query, output the result of the query **CALC 1 N** on a new line. Additionally, after each **CALC** query, output the result of that query on a new line. For example, if a **CALC L R** query is received, first provide the answer to **CALC 1 N**, and then on a new line, the answer to **CALC L R**.
Ensure the answers to the queries are output with a precision of at least 4 decimal places.
**Example Explanation**: We have 5 tanks with a density of 1000. There are 10 queries to process.
1. **INS 1 800 2**: Execute this query and display the result of **CALC 1 5**. 2. **INC 1 4**: Execute this query and display the result of **CALC 1 5**. 3. **DEL 2**: Execute this query and display the result of **CALC 1 5**. 4. **INS 3 1200 5**: Execute this query and display the result of **CALC 1 5**. 5. **INS 4 300 10**: Execute this query and display the result of **CALC 1 5**. 6. **DEC 2 25**: Execute this query and display the result of **CALC 1 5**. 7. **CALC 1 3**: Display the result of **CALC 1 5** and then execute this query. 8. **INC 3 500**: Execute this query and display the result of **CALC 1 5**. 9. **CALC 3 4**: Display the result of **CALC 1 5** and then execute this query. 10. **DEL 1**: Execute this query and display the result of **CALC 1 5**.