Aggresive cow brute force

can i get brute force explanation or way to solve this question ( without binary search ) for better understanding .

thank you