Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A network setup company was contracted by an IT firm to establish servers and client machines in their new building. However, upon completion of the

A network setup company was contracted by an IT firm to establish servers and client machines in their new
building. However, upon completion of the network setup, significant connection issues were discovered,
requiring extensive time and effort to rectify.
The building's head office is a multi-level structure comprising L levels, with O offices on each level. A server
is installed on every level. As per the network design, connections to all offices on a level are operational only
when the respective server is online. Unfortunately, due to errors in the network setup, some offices have
incorrect connections. These offices are connected and functional only when the server is offline. It is
conceivable for a level to have both correctly and incorrectly connected offices.
Correcting all network connections would incur substantial expenses, which the IT company finds prohibitive.
Instead, they opt to optimize network connectivity by initially activating all servers and subsequently
deactivating precisely S of them to maximize the total number of online offices in the building.
Write a program to help maximize the online offices!
Input Format
The first line reads 3 integers L,O and S where L is the number of levels in the building, O is the number of
offices on each level, and S is the number of servers which would be turned off. Each of the next L input
lines, has an integer between 0 and O which gives the number of offices that are online on that level.
Constraints
o.1SL106
1
Output Format
An integer values giving the total number of online offices.
Sample Input 0
321
2
1
o.
Write on java
image text in transcribed

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

Step: 3

blur-text-image

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

Databases And Information Systems 1 International Baltic Conference Dbandis 2020 Tallinn Estonia June 19 2020 Proceedings

Authors: Tarmo Robal ,Hele-Mai Haav ,Jaan Penjam ,Raimundas Matulevicius

1st Edition

303057671X, 978-3030576714

More Books

Students also viewed these Databases questions