Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedOutput

image text in transcribed

Constraintsimage text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application Development And Administration

Authors: Michael V. Mannino

3rd Edition

0071107010, 978-0071107013

More Books

Students also viewed these Databases questions

Question

5. Write down the merits and demerits of codification.

Answered: 1 week ago

Question

What is the purpose of brand management?

Answered: 1 week ago

Question

Why is the System Build Process an iterative process?

Answered: 1 week ago