#K47957. Inventory Usage Calculation
Inventory Usage Calculation
Inventory Usage Calculation
In this problem, you are given the daily usage data for several inventory items. Each item has a list of daily usage values. Your task is to compute the total usage across all items and to determine if any single daily usage exceeds a given threshold. Formally, let (U_{i,j}) represent the usage of the (i)-th item on day (j), and let (T) be the threshold. You need to compute (S = \sum_{i}\sum_{j} U_{i,j}) and determine whether (\max_{i,j}, U_{i,j} > T). The output consists of the total usage and a boolean value (True/False) based on this condition. This problem mimics real-life inventory monitoring tasks.
inputFormat
The input is read from standard input (stdin) and has the following format:
- The first line contains an integer (N) representing the number of items.
- For each item, the input consists of:
- A line with the item name (a string).
- A line with an integer (M) representing the number of days.
- A line with (M) space-separated integers representing the daily usage values for that item.
- The last line contains an integer representing the threshold.
outputFormat
The output is written to standard output (stdout) and should contain two lines:
- The first line is an integer representing the total usage, i.e., the sum of all daily usage values across all items.
- The second line is either 'True' if any single daily usage exceeds the threshold, or 'False' otherwise.## sample
3
widgets
4
5 3 7 10
gadgets
4
4 8 2 1
thingamajigs
4
9 1 5 7
8
62
True
</p>