Help in https://codeforces.com/contest/1098/problem/C

I was trying to solve this problem from codeforces.

https://codeforces.com/contest/1098/problem/C

I understood upto the part where binary search was used to calculate the minimum value of branching coefficient but i am not able to build the tree from s, n and binary coefficient.
can someone explain the idea. It’s not clear in the editorial.

link to editorial : https://codeforces.com/blog/entry/64331
I did not understand this part
We know that the tree can be rebuilt so that the sum is any between maximum and minimum, so there are two conditions, which are satisfied (we want to put value π‘₯x to position 𝑖i).

  • π‘₯x must be big enough, so if we fill suffix with numbers π‘₯x, π‘₯β‹…π‘˜xβ‹…k, π‘₯β‹…π‘˜2xβ‹…k2, … (the last non-zero number can be smaller, sum of numbers is 𝑛n) sum of sizes of subtrees will be not greater to 𝑠s.
  • π‘₯x must be small enough, so if we fill suffix with 11, sum of sizes of subtrees will be not less than 𝑠s