670A - Holidays
670A - Holidays
- #include<iostream>
- using namespace std;
- int main()
- {
- long n;
- cin>>n;
- long d=0,x=0;int i=1;
- long m=n;
- ///max
- d=n/7;
- x= n- 7*d;
- if(x>=2 and x!=0) x=2;
- else if(x<2 and x!=0) x=1;
- ///min
- int mn=0;
- while(m--){
- n=n-5;
- if(n>=2 and n!=0){ mn+=2; n=n-2;}
- else if(n>=1 and n!=0 ){ mn+=1; n=n-1;}
- //cout<<n<<" ";
- }
- cout<<mn<<" ";
- cout<<2*d+x;
- return 0;
- }
Comments
Post a Comment