Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdio>
- int main()
- {
- int L;
- scanf("%d",&L);
- int bottles = L/7;
- if (L>=7 && L%7==3)
- {
- bottles++;
- printf("%d",bottles);
- return 0;
- }
- if (L>=7 && L%7==4)
- {
- bottles += 2;
- printf("%d",bottles);
- return 0;
- }
- L %= 7;
- bottles += L/5;
- L %= 5;
- bottles += L;
- printf("%d",bottles);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement