#P2095. Mr.L's Bulking Diet Plan
Mr.L's Bulking Diet Plan
Mr.L's Bulking Diet Plan
Mr.L is on a bulking plan and wants to consume as much fat as possible while following a balanced nutritional diet. His research shows that a nutritious meal should not contain more than a restricted number of servings from each food category. Specifically, for each meal:
- Meat: at most $1$ serving
- Fish: at most $1$ serving
- Eggs: at most $1$ serving
- Vegetables: at most $2$ servings
The fat content (in arbitrary units) from each serving is as follows:
- Eggs: $12$
- Meat: $10$
- Fish: $8$
- Vegetables: $5$ (each, note there can be up to $2$ servings)
Due to his limited appetite, Mr.L can only consume a total of C servings in one meal. He must choose servings in a descending order of fat content up to both his capacity and the maximum allowed servings for each category. Your task is to compute the maximum total fat intake achievable under these constraints. Note that even if his capacity C exceeds the sum of maximum allowable servings (which is $1+1+1+2=5$), he cannot consume more than the permitted number of servings.
inputFormat
The first line of input contains an integer T representing the number of test cases. Each of the following T lines contains an integer C (where C ≥ 0), which denotes Mr.L's eating capacity (in servings) for that meal.
outputFormat
For each test case, output a single line containing the maximum fat intake (in arbitrary units) Mr.L can achieve under the dietary constraints.
sample
1
0
0