Holidays

版权声明:来自星空计算机团队——申屠志刚 https://blog.csdn.net/weixin_43272781/article/details/84000452

https://codeforces.com/contest/670/problem/A

time limit per test

1 second

memory limit per test

256 megabytes

input

standard input

output

standard output

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

Copy

2

output

0 2

Note

In the first sample there are 14 days in a year on Mars, and therefore independently of the day a year starts with there will be exactly 4days off .

In the second sample there are only 2 days in a year on Mars, and they can both be either work days or days off.

题解:

水题

#include <iostream>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <math.h>
#include <set>
#include <map>
using namespace std;
int n;
int main()
{
    scanf("%d",&n);
    int minday=n/7*2,maxday=n;
    if(n%7==6)
        minday++;
    if(n>2){
        maxday=2;
        n-=2;
        maxday+=n/7*2;
        if(n%7==6)
            maxday++;
    }
    cout << minday << " "<< maxday << endl;
    //cout << "Hello world!" << endl;
    return 0;
}

猜你喜欢

转载自blog.csdn.net/weixin_43272781/article/details/84000452