fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n, k;
  6. cin >> n >> k;
  7.  
  8. int days = n;
  9. int vo_bao = n;
  10.  
  11. while (vo_bao >= k) {
  12. int bao_moi = vo_bao / k;
  13. days += bao_moi;
  14. vo_bao = vo_bao % k + bao_moi;
  15. }
  16.  
  17. cout << days << endl;
  18. return 0;
  19. }
  20.  
Success #stdin #stdout 0.01s 5276KB
stdin
Standard input is empty
stdout
1909405619