We all know about the recent flood in Sylhet. Every area of Sylhet can be expressed with a number. If there are n number of areas in Sylhet then they can be expressed as 1, 2, 3...n-1n. Where the in area is located after the (-1) area. Volume of each area of Sylhet is 1 meter. A few dams have been constructed in certain areas in Sylhet. Each dam is pre-planned to be built at a certain height so that the flood water cannot completely inundate the city. Flood water will enter through the 1 area. The height of the dam in the area is B, meter. If the water level in area i is greater than B meter then the remaining water will flow in (i+1), area. Due to the good communication system of Sylhet people can move from one area to another before any danger. Sylhet is the city of rain. Every area has some tall buildings built to deal with the flood problem. The building in the fe area has H, floors and each floor has a height of Imeter. Due to the weather forecast people can know how much water will flow in Sylhet city. One floor can accommodate I person. But when a floor goes under water, that floor becomes uninhabitable. So there will be a housing crisis for many people. So the local authority decided to build extra floors in some buildings. You have to print the minimum number of floors to build so that all people can stay safe. if the water level exceeds the height of the dam in n area, the excess water will spill into the sea. if an area is not inundated, everyone will take shelter in buildings due to the advance forecast of floods. Input The first line will contain n. Number of areas in Sylhett1
We all know about the recent flood in Sylhet. Every area of Sylhet can be expressed with a number. If there are n number of areas in Sylhet then they can be expressed as 1, 2, 3...n-1n. Where the in area is located after the (-1) area. Volume of each area of Sylhet is 1 meter. A few dams have been constructed in certain areas in Sylhet. Each dam is pre-planned to be built at a certain height so that the flood water cannot completely inundate the city. Flood water will enter through the 1 area. The height of the dam in the area is B, meter. If the water level in area i is greater than B meter then the remaining water will flow in (i+1), area. Due to the good communication system of Sylhet people can move from one area to another before any danger. Sylhet is the city of rain. Every area has some tall buildings built to deal with the flood problem. The building in the fe area has H, floors and each floor has a height of Imeter. Due to the weather forecast people can know how much water will flow in Sylhet city. One floor can accommodate I person. But when a floor goes under water, that floor becomes uninhabitable. So there will be a housing crisis for many people. So the local authority decided to build extra floors in some buildings. You have to print the minimum number of floors to build so that all people can stay safe. if the water level exceeds the height of the dam in n area, the excess water will spill into the sea. if an area is not inundated, everyone will take shelter in buildings due to the advance forecast of floods. Input The first line will contain n. Number of areas in Sylhett1
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps with 2 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education