Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Standard Input Output Constraints Standard input The input begins with two integers N and Q. Next come N lines each describing all divisions in the
Standard Input
Output
Constraints
Standard input The input begins with two integers N and Q. Next come N lines each describing all divisions in the following format: 1 [division_name] [parent_division] [size1] [size2)] 2 where [division_name] is a child of [parent_division] [size1] is the number of employees in [division_name] but not any child division below it in the corporate hierarchy. [size2] is the number of employees in [division_name] including all divisions below it in the corporate hierarchy 4 5 6 If there is no parent, the [parent_division] will be equal to "NONE". 7 If a size is missing, the size value will be set to e 8 Next come Qlines each describing each query in the form 1 [division_name] Itype] 2 where [division_name] is a division name that exists in the corporate hierarchy, and [type] is either 1 or 2 4. 5 Standard input The input begins with two integers N and Q. Next come N lines each describing all divisions in the following format: 1 [division_name] [parent_division] [size1] [size2)] 2 where [division_name] is a child of [parent_division] [size1] is the number of employees in [division_name] but not any child division below it in the corporate hierarchy. [size2] is the number of employees in [division_name] including all divisions below it in the corporate hierarchy 4 5 6 If there is no parent, the [parent_division] will be equal to "NONE". 7 If a size is missing, the size value will be set to e 8 Next come Qlines each describing each query in the form 1 [division_name] Itype] 2 where [division_name] is a division name that exists in the corporate hierarchy, and [type] is either 1 or 2 4. 5Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started