https://codeforces.com/contest/1154/problem/C
题意:你有只猫,周一、四、日吃鱼,周二、六吃兔肉。其余时间吃鸡肉。现在你要去旅行,且你准备了a份鱼、b份兔肉、c份鸡肉。求你在某天出门后这只猫能吃的的最大天数。
题解:枚举
1、枚举开始的星期几;
2、规律(这个天数跟你周几出门有关
/*
*@Author: STZG
*@Language: C++
*/
#include <bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<cstdlib>
#include<cstring>
#include<cstdio>
#include<string>
#include<vector>
#include<bitset>
#include<queue>
#include<deque>
#include<stack>
#include<cmath>
#include<list>
#include<map>
#include<set>
//#define DEBUG
#define RI register int
#define endl "\n"
using namespace std;
typedef long long ll;
//typedef __int128 lll;
const int N=100000+10;
const int M=100000+10;
const int MOD=1e9+7;
const double PI = acos(-1.0);
const double EXP = 1E-8;
const int INF = 0x3f3f3f3f;
int t,n,m,k,p,l,r,u,v;
ll ans,cnt,flag,temp,sum;
int a[4],b[8]={0,1,2,3,1,3,2,1},c[4];//fish food, rabbit stew and chicken stakes
char str;
struct node{};
ll checked(int week){
ll day=0;
for(int i=1;i<=3;i++)
c[i]=a[i];
for(int i=week;i<=7;i++){
if(c[b[i]])c[b[i]]--,day++;
else return i-week;
}
ll mid=min(c[1]/3,min(c[2]/2,c[3]/2));
day+=(mid*7);
c[1]-=(mid*3);
c[2]-=(mid*2);
c[3]-=(mid*2);
for(int i=1;i<=7;i++){
if(c[b[i]])c[b[i]]--,day++;
else break;
}
return day;
}
int main()
{
#ifdef DEBUG
freopen("input.in", "r", stdin);
//freopen("output.out", "w", stdout);
#endif
//ios::sync_with_stdio(false);
//cin.tie(0);
//cout.tie(0);
//scanf("%d",&t);
//while(t--){
scanf("%d%d%d",&a[1],&a[2],&a[3]);
for(int i=1;i<=7;i++){//cout<<checked(i)<<endl;
ans=max(ans,checked(i));
}
cout<<ans<<endl;
//}
#ifdef DEBUG
printf("Time cost : %lf s\n",(double)clock()/CLOCKS_PER_SEC);
#endif
//cout << "Hello world!" << endl;
return 0;
}