Question: 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![the following format: 1 [division_name] [parent_division] [size1] [size2)] 2 where [division_name] is](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f52bac99791_53266f52bac3a82e.jpg)
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. 5
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
