N = 11 F = 5 T = 3 bags = 0 while N >= 0: if N % F == 0: bags += N // F break N -= T bags += 1 print(bags)
To embed this project on your website, copy the following code and paste it into your website's HTML: