On the planet Mars a year lasts exactly n days (there are no leap years on Mars). But Martians have the same weeks as earthlings — 5 work days and then 2 days off. Your task is to determine the minimum possible and the maximum possible number of days off per year on Mars.
Input
The first line of the input contains a positive integer n (1 ≤ n ≤ 1 000 000) — the number of days in a year on Mars.
Output
Print two integers — the minimum possible and the maximum possible number of days off per year on Mars.
Examples
input
14
output
4 4
input
2
output
0 2
My Answer Code:
/*
AUthor:Albert Tesla Wizard
TIme:2021/4/14 18:38
*/
#include<bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
int n,Min,Max;
cin>>n;
if(n<6)Min=0;
else Min=(n-6)/7+n/7+1;
if(n<2)Max=n;
else if(n<=9)Max=(n-2)/6+(n-2)/7+2;
else Max=(n-2)/7+(n-8)/7+3;
cout<<Min<<" "<<Max<<'\n';
return 0;
}
506





