Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- long long getMin(long long n) {
- long long min = (n / 7 ) * 2;
- long long saturday = n % 7;
- if (saturday == 6) min++;
- return min;
- }
- long long getMax(long long n) {
- long long max = 2 + (n / 7) * 2;
- if (n % 7 == 0)
- max -= 2;
- else if (n % 7 == 1)
- max -= 1;
- return max;
- }
- int main(){
- long long n;
- cin>>n;
- cout << getMin(n) << " " << getMax(n);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement