Description
On the planet Mars A is lasts exactly n days (there is no leap years on Mars). But Martians has the same weeks as earthlings-5 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)-the number of Da Ys in a year on Mars.
Output
Print 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
Give me a few days, ask at least a few holidays, up to a few holidays ~
Look at the remainder of the situation ~
Just a discussion.
#include <stdio.h>//#include <bits/stdc++.h> #include <string.h> #include <iostream> #include <stack> #include <math.h> #include <map> #include <sstream> #include <set> #include < queue> #include <vector> #include <algorithm> #include <limits.h> #define INF 0x3fffffff#define LLL L,m,rt<<1#define RRR r,m+1,rt<<1|1using namespace Std;int main () {int n; cin>>n; if (n==1) {cout<< "0" << "" << "1" <<endl; } else if (2<=n&&n<=5) {cout<< "0" << "" << "2" <<endl; } else if (n==6) {cout<< "1" << "" << "2" <<endl; } else {int pot; int POS; pot=n/7*2; pos=n/7*2; if (n%7>=0&&n%7<=5) {cout<<pot<< ""; } else {cout<<pot+1<< ""; } if (n%7==1) {COUT≪<pos+1<<endl; } else if (n%7==0) {cout<<pos<<endl; } else {cout<<pos+2<<endl; }} return 0;}
Codeforces Round #350 (Div. 2) A