- Thoughts.
- A naive search for a number that satisfies the condition is 10^10, no.
- Calculated for each b
- 0 if less than k
- If larger, divide N by b ā q, r
- ret = q * (b - k)
- If r > k, ret += r - k
- Official Explanation OK
- Thereās one discrepancy, but Iām sure it can be fixed quickly with a test case.
This page is auto-translated from /nishio/ARC091B using DeepL. If you looks something interesting but the auto-translated English is not good enough to understand it, feel free to let me know at @nishio_en. Iām very happy to spread my thought to non-Japanese readers.