How to determine the number of groups?


In questions such as these, is there any trick to find the number of groups that help us divide the number of blocks?
Would the number of groups to divide always be three?

Ternary search. This is simply a brainteaser.

Try smaller examples.