Trial and error specifies that you should guess the value of m and see if you aimed too low too high then adjust your next guess based on that.
Suppose we don't already know what m is (even though it is completely obvious), let's pick m to be 6,
So we check,
but
which means m must be bigger.
So we pick m to be 8 and check,
but
which means m must be smaller.
Since only natural number between 6 and 8 is 7 we pick m to be 7 and check,
and
.
The answer is therefore 7.
Hope this helps :)