Given the volume V of a tank in liter. There is a pump which is filling the tank at speed of M liter per minute. There is a leakage at the bottom of the tank which wasting water at speed N liter per minute. Given N is less than M. The task is to calculate how much amount of water will be wasted if leakage is seen after filling the full tank.
Input : V = 700, M = 10, N = 3 Output : 300 Input : V = 1000, M = 100, N = 50 Output : 1000
Approach : Given the speed of filling pump is M liter per minute. So, the amount of water filled in one minute is M Liter. Also, N litres of water is wasted in a minute. Therefore after one minute the amount of water in the tank will be (M – N). Hence total time taken to fill the tank with leakage will be V / (M-N).
Therefore the amount of wasted water will be (V / (M-N)) * N.
Below is the implementation of the above approach:
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Program to check if water tank overflows when n solid balls are dipped in the water tank
- Program to find amount of water in a given glass
- Find amount to be added to achieve target ratio in a given mixture
- Find out the minimum number of coins required to pay total amount
- Find the maximum angle at which we can tilt the bottle without spilling any water
- Fill array with 1's using minimum iterations of filling neighbors
- Program to check if tank will overflow, underflow or filled in given time
- Container with Most Water
- Minimum sprinklers required to water a rectangular park
- Measure one litre using two vessels and infinite water supply
- Find (1^n + 2^n + 3^n + 4^n) mod 5 | Set 2
- Find value of (1^n + 2^n + 3^n + 4^n ) mod 5
- Find the value of max(f(x)) - min(f(x)) for a given F(x)
- Find 2^(2^A) % B
- Find value of (n^1 + n^2 + n^3 + n^4) mod 5 for given n
- Find N from the value of N!
- Find the value of f(n) / f(r) * f(n-r)
- Find K such that |A - K| = |B - K|
- Find the value of N when F(N) = f(a)+f(b) where a+b is the minimum possible and a*b = N
- Find x, y, z that satisfy 2/n = 1/x + 1/y + 1/z
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.