How to find integer solutions of K for equation floor(A/K) = B, in terms of A and B where A and B are non-negative integers?
- What I tried:
- floor(A/K) = B
- then B <= A/K < B + 1
- then BK <= A < BK + K
- but I don't know how to proceed further.
How to find integer solutions of K for equation floor(A/K) = B, in terms of A and B where A and B are non-negative integers?
Copyright © 2021 JogjaFile Inc.
If $\lfloor\frac{A}{K}\rfloor=B$ then $\frac{A}{K} - 1 \leq B \leq \frac{A}{K} + 1$, so $\frac{A}{B+1} \leq K \leq \frac{A}{B-1}$