|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|4 초||128 MB||1||1||1||100.000%|
The Unknown Trading Company have installed a new inventory-tracking system, which stores a complete database of goods and trading points worldwide. Each salespoint and each item was assigned an integer unique identifier (id). For every sale, the system logs id of the item, number of items sold, and id of the salespoint.
Your task is to output a summary report, tabulating total sales by items and salespoints. The report must be a two-dimensional table, with the first row containing item ids in increasing order, first column containing salespoint ids in increasing order, and values inside the table representing total sales of corresponding item from the corresponding salespoint. The value in first column of the first row must be −1. The values in cells without corresponding sales must be 0.
Input contains number of records N, followed by N triplets of integers qi si vi, where qi -- item id, si -- salespoint id, vi -- number of items sold.
Output file must a table as described above, row-by-row.
4 10 1 3 20 2 5 10 2 2 20 2 1
-1 10 20 1 3 0 2 2 6
1 1 1 5
-1 1 1 5