ceil(A/B) < C closed form
Difference between en1 and en2, changed 0 character(s)
Recently, I came upon this problem:↵

Given: A, C, and that ceil(A/B) < C↵

Find: the smallest B possible↵

My solution was using binary search. ↵
However, the official solution came up with this clever closed form formula:↵

~~~~~↵
B = ceil(A/(C-1))↵
~~~~~↵

I'm completely boggled by this equation. I've seen quite a few closed form equations involving floor and ceil before, but I can't find how they are derived.↵

Any help, explanation, or pointers appreciated!

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English daftdove 2023-02-26 08:58:41 0 (published)
en1 English daftdove 2023-02-26 08:58:10 497 Initial revision (saved to drafts)