Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1. #include <cstdio>
  2.  
  3. int main()
  4. {
  5.     int L;
  6.     scanf("%d",&L);
  7.    
  8.     int bottles = L/7;
  9.     if (L>=7 && L%7==3)
  10.     {
  11.         bottles++;
  12.         printf("%d",bottles);
  13.         return 0;
  14.     }
  15.        
  16.     if (L>=7 && L%7==4)
  17.     {
  18.         bottles += 2;
  19.         printf("%d",bottles);
  20.         return 0;
  21.     }
  22.        
  23.     L %= 7;
  24.     bottles += L/5;
  25.     L %= 5;
  26.     bottles += L;
  27.     printf("%d",bottles);    
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement