The maximum number of ones I can increase in one operation =>
k - 1
How can I do that? => remove n
and add
(k - 1
ones and n - (k - 1)
)
For example, (n, k) = (16, 4)
{16}: initial state
{1, 1, 1, 13}
{1, 1, 1, 1, 1, 1, 10}
{1, 1, 1, 1, 1, 1, 1, 1, 1, 7}
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4}
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}
My takeaway is that I should think about the optimal number and consider how to do it after the observation.
for _ in range(int(input())):
n, k = map(int, input().split())
count: int = 0
while n > 1:
n -= k - 1
count += 1
print(count)
Ketone 5 mg/dl
Protein shake 15g Sushi salad 15g Cheese 10g
Total carbohydrate 40g
MUST:
TODO: