vadimk772336

1

Dec 21st, 2021
1,050
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. int main()
  4. {
  5.     int N, M, K;
  6.     std::cin >> N >> K >> M;
  7.  
  8.     int count_substances = K - K % M;
  9.     int count = 0;
  10.  
  11.     while (N >= K)
  12.     {
  13.         N -= count_substances;
  14.         count++;
  15.     }
  16.  
  17.     std::cout << count * (K / M) << std::endl;
  18.     return 0;
  19. }
  20.  
Advertisement
Add Comment
Please, Sign In to add comment