ceil(A/B) < C closed form

Правка en1, от daftdove, 2023-02-26 08:58:10

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!

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский daftdove 2023-02-26 08:58:41 0 (published)
en1 Английский daftdove 2023-02-26 08:58:10 497 Initial revision (saved to drafts)