#K52052. Retail Store Inventory Management

    ID: 29223 Type: Default 1000ms 256MiB

Retail Store Inventory Management

Retail Store Inventory Management

You are tasked with simulating the inventory management of a retail store. The store comprises 3 sections, each containing 10 products. Initially, every product in every section has a stock level of 0.

Update notices are provided in the form of three integers: \(s\), \(p\), and \(c\). Here, \(s\) (with \(1 \leq s \leq 3\)) represents the section number, \(p\) (with \(1 \leq p \leq 10\)) represents the product number in that section (1-indexed), and \(c\) is the change in the inventory (which can be positive or negative). For every update notice, adjust the corresponding product’s stock in the given section accordingly.

After processing all the update notices, you need to output the inventory levels of all sections in a specific format. The output should list the stock levels for section 1, followed by a separator line of 20 asterisks, then the stock levels for section 2, another separator, and finally the stock levels for section 3.

inputFormat

The input is read from standard input (stdin) and has the following format:

  • The first line contains an integer \(n\), the number of update notices.
  • The next \(n\) lines each contain three space-separated integers \(s\), \(p\), and \(c\), representing an update notice for section \(s\), product \(p\) (1-indexed), and the change \(c\) in stock, respectively.

outputFormat

The output is printed to standard output (stdout) and must consist of 5 lines:

  1. The first line contains the stock levels for section 1 as 10 space-separated integers.
  2. The second line is a separator line that contains exactly 20 asterisks ("********************").
  3. The third line contains the stock levels for section 2 as 10 space-separated integers.
  4. The fourth line is another separator line with 20 asterisks.
  5. The fifth line contains the stock levels for section 3 as 10 space-separated integers.
## sample
4
1 2 15
3 1 5
2 10 -3
1 5 7
0 15 0 0 7 0 0 0 0 0

0 0 0 0 0 0 0 0 0 -3


5 0 0 0 0 0 0 0 0 0

</p>