Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8329479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:48:08+00:00 2026-06-09T01:48:08+00:00

This question was asked in a forum. Any suggestions? There is a pyramid with

  • 0

This question was asked in a forum. Any suggestions?

There is a pyramid with 1 cup at level , 2 at level 2 , 3 at level 3 and so on..
It looks something like this

  1
 2 3
4 5 6

every cup has capacity C. you pour L liters of water from top . when cup 1 gets filled , it overflows to cup 2,3 equally, and when they get filled , Cup 4 and 6 get water only from 2 and 3 resp but 5 gets water from both the cups and so on.
Now given C and L .Find the amount of water in ith cup ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T01:48:10+00:00Added an answer on June 9, 2026 at 1:48 am

    Each glass has an incoming flow, an amount of water in the glass, and maybe some outgoing flow (overflow).

    If each glass can contain 1 unit of water, and you pour 15 units of water, you get the following (overflow amount in parenthesis):

    Incoming flow = 15, capacity = 1
    
    Level 1:               1(14)
    Level 2:           1(6)     1(6)
    Level 3:       1(2)     1(5)     1(2)
    Level 4:    1(1)   1(2.5)  1(2.5)    1(1)
    Level 5:   1  1(0.75)  1(1.5)  1(0.75)   1
    Level 6:  0 0.375 1(0.125) 1(0.125) 0.375 0
    Level 7: 0 0  0.0625   0.125    0.0625   0 0
    

    The incoming flow to the first level is L. The incoming flow from glass c on level r is Fin(c, r), and could be written as:

    Fin(0, r) = 0
    Fin(r+1, r) = 0
    Fin(1, 1) = L
    Fin(c, r) = Fout(c - 1, r - 1)/2 + Fout(c, r - 1)/2
    

    The amount of water in that glass is:

    A(c, r) = Min(C, Fin(c, r))
    

    And the outgoing flow is:

    Fout(c, r) = Max(0, Fin(c, r) - C)
    

    I don’t see any obvious formula for evaluating A(c, r) without doing it recursively.


    To get from an index to a row and glass position, you can do:

    index = r*(r-1)/2 + c
    
    r = floor((1 + sqrt(8*index - 7))/2)
    c = index - r*(r-1)/2
    
    (indexes start with 1)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have already asked this question on asp.net forum, could not find any satisfactory
Introduction: I asked this question on the P2-forum already but I couldnt get any
I've already asked this question on several forums, but without any good explanation of
I asked this question on the SCB forum but got no answer I'm trying
This question has been asked in various forms in a number of different forums,
I've asked this question twice before, with no real progress. After trolling countless forum
I know this question has been asked before but the solutions did not work
I know this question has been asked before and I have seen a plethora
This question has been asked before mentioning the lib or includes that provides a
Hey all, I know that this question has been asked many times in this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.