CF1154C.Gourmet Cat
普及/提高-
通过率:0%
时间限制:1.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Polycarp has a cat and his cat is a real gourmet! Dependent on a day of the week he eats certain type of food:
- on Mondays, Thursdays and Sundays he eats fish food;
- on Tuesdays and Saturdays he eats rabbit stew;
- on other days of week he eats chicken stake.
Polycarp plans to go on a trip and already packed his backpack. His backpack contains:
- a daily rations of fish food;
- b daily rations of rabbit stew;
- c daily rations of chicken stakes.
Polycarp has to choose such day of the week to start his trip that his cat can eat without additional food purchases as long as possible. Print the maximum number of days the cat can eat in a trip without additional food purchases, if Polycarp chooses the day of the week to start his trip optimally.
波利卡普有一只猫,而他的猫是一位真正的美食家!根据一周中的不同日期,猫会吃特定类型的食物:
- 星期一、星期四和星期日吃鱼食;
- 星期二和星期六吃兔肉炖菜;
- 一周中的其他日子吃鸡肉排。
波利卡普计划去旅行,并已将背包收拾好。他的背包中包含:
- a 份每日份量的鱼食;
- b 份每日份量的兔肉炖菜;
- c 份每日份量的鸡肉排。
波利卡普必须选择一周中的某一天作为旅行开始日,使得他的猫在无需额外购买食物的前提下尽可能长时间地进食。如果波利卡普能最优地选择旅行开始日,请输出猫在旅行中无需额外购买食物所能进食的最大天数。
输入格式
The first line of the input contains three positive integers a, b and c (1≤a,b,c≤7⋅108) — the number of daily rations of fish food, rabbit stew and chicken stakes in Polycarps backpack correspondingly.
输入的第一行包含三个正整数 a、b 和 c(1≤a,b,c≤7⋅108),分别表示 Polycarp 背包中鱼食、兔肉炖菜和鸡肉串的每日口粮数量。
输出格式
Print the maximum number of days the cat can eat in a trip without additional food purchases, if Polycarp chooses the day of the week to start his trip optimally.
如果 Polycarp 选择一周中最佳的出发日期,打印猫咪在无需额外购买食物的情况下最多能吃多少天。
输入输出样例
输入#1
2 1 1
输出#1
4
输入#2
3 2 2
输出#2
7
输入#3
1 100 1
输出#3
3
输入#4
30 20 10
输出#4
39
说明/提示
In the first example the best day for start of the trip is Sunday. In this case, during Sunday and Monday the cat will eat fish food, during Tuesday — rabbit stew and during Wednesday — chicken stake. So, after four days of the trip all food will be eaten.
In the second example Polycarp can start his trip in any day of the week. In any case there are food supplies only for one week in Polycarps backpack.
In the third example Polycarp can start his trip in any day, excluding Wednesday, Saturday and Sunday. In this case, the cat will eat three different dishes in three days. Nevertheless that after three days of a trip there will be 99 portions of rabbit stew in a backpack, can cannot eat anything in fourth day of a trip.
在第一个例子中,旅行的最佳开始日期是星期日。此时,猫在星期日和星期一将食用鱼肉食品,星期二食用兔肉炖菜,星期三食用鸡肉排。因此,经过四天的旅行后,所有食物都将被吃完。
在第二个例子中,Polycarp 可以在一周中的任意一天开始他的旅行。无论在哪一天开始,Polycarp 背包中的食物供应量都仅够维持一周。
在第三个例子中,Polycarp 可以在除星期三、星期六和星期日外的任意一天开始他的旅行。此时,猫将在三天内食用三种不同的菜肴。尽管经过三天的旅行后背包中仍剩余 99 份兔肉炖菜,但在旅行的第四天猫将无法再食用任何食物。
输入解题思路,AI测评打分。不知道怎么写?