I remember it's one of problems in following book:
Heard on The Street: Quantitative Questions from Wall Street Job Interviews
Please check the answer in the book. I remember tThe key idea is to make full use of all balls in each scaling...I know this does not make sense, but it's like, for example, after you kick out six balls in the first scaling,
you can borrow some balls back later in following scalings.