3种东西,指定星期几可以使用,问你最多能用几天
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll x[3], z[3];
int y[] = { 0, 1, 2, 0, 2, 1, 0 };
int main()
{
cin >> x[0] >> x[1] >> x[2];
ll X = min( x[0] / 3,min(x[1] / 2, x[2] / 2 ));
x[0] -= X * 3, x[1] -= X * 2, x[2] -= X * 2;
X*=7;
ll res=X;
for (int i = 0; i < 7; ++i)
{
z[0] = x[0], z[1] = x[1], z[2] = x[2];
int cnt = 0;
for (int j = i; z[y[j]]--; j = (j + 1) % 7)
cnt++;
res = max(res, X + cnt);
}
printf("%lld\n",res);
return 0;
}