Q:

How does $A$ relate to $B$ if $A - \lfloor A/B \rfloor - \lceil A/B \rceil \leq \lfloor A/B \rfloor \times (B+1)$?

For $A \geq B$, both are strictly positive integers, what is the relationship between $A$ and $B$ such that the following is true?
$$A - \lfloor A/B \rfloor - \lceil A/B \rceil \leq \lfloor A/B \rfloor \times (B+1)$$
Previously I asked this question can be here, and a counterexample has been shown to disprove it. Now I'd like to ask whether we can find the conditions (an expression in terms of $A$ and $B$) such that the above is true.
One thing I noticed (a generalisation from @Clement Yung's answer in my original post - thanks!) is that if $B = \lceil A/k \rceil$ (for any constant $k$), then the above is false. I wonder if there are any other cases such that it's false, or if better if there's condition(s) for when it is always true.

A:

Consider firstly the case in which $A=B$ and then $A/B=1$. In this case, $\lfloor A/B\rfloor=\lceil A/B\rceil=1$, so that the inequality of the OP would reduce to
$$A-3\lfloor A/B \rfloor \leq B \lfloor A/B \rfloor$$
$$A-3\leq A $$
which is trivially true.
If $A/B>1$, then $\lfloor A/B\rfloor+1=\lceil A/B\rceil$, so that the inequality becomes
$$A-3\lfloor A/B \rfloor -1\leq B \lfloor A/B \rfloor$$
$$A-(B+3)\lfloor A/B \rfloor -1\leq 0$$
$$\lfloor A/B \rfloor\geq \frac{A-1}{B+3}$$
This is the condition needed to satisfy the initial inequality of the OP.

For example, if $A=5$ and $B=2$, then the condition is satisfied since $$\lfloor 5/2 \rfloor=2 > \frac{5-1}{2+3}=\frac 45$$
Accordingly, for these values the initial inequality holds, as it gives
$$5-2-3\leq 2\cdot 3$$
$$0\leq 6$$
As another example, if $A=12$ and $B=7$, then the condition is not satisfied since $$\lfloor 12/7 \rfloor=1 < \frac{12-1}{7+3}=\frac {11}{10}$$
Accordingly, for these values the initial inequality does not hold, since it would give
$$12-1-2\leq 1\cdot 7$$
$$9\leq 7$$

