We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Look dude the only thing required is knowing how many jars are to be filled and multiplying them with capacity given. And then keep on adding the result for as many operations is given.
At last find the average.
Hope it helps.
while(o>0)
{
scanf("%ld%ld%ld",&st,&en,&cap);
res = res + ((en-st)+1)*cap;
o--;
}
fin = floor(res/n);
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Filling Jars
You are viewing a single comment's thread. Return to all comments →
Look dude the only thing required is knowing how many jars are to be filled and multiplying them with capacity given. And then keep on adding the result for as many operations is given. At last find the average.
Hope it helps.
while(o>0)
{ scanf("%ld%ld%ld",&st,&en,&cap);