Advertisement
Guest User

Untitled

a guest
Nov 14th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5. long long getMin(long long n) {
  6.   long long min = (n / 7 ) * 2;
  7.   long long saturday = n % 7;
  8.   if (saturday == 6) min++;  
  9.   return min;
  10. }
  11.  
  12.  
  13. long long getMax(long long n) {  
  14.   long long max = 2 + (n / 7) * 2;
  15.  
  16.   if (n % 7 == 0)
  17.     max -= 2;
  18.   else if (n % 7 == 1)
  19.     max -= 1;
  20.  
  21.   return max;
  22.  
  23. }
  24. int main(){
  25.   long long n;
  26.   cin>>n;
  27. cout << getMin(n) << " " << getMax(n);
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement