Wesley's Anger Contest 3 Problem 2 - Eat, Sleep, Code, Repeat

View as PDF

Submit solution


Points: 5 (partial)
Time limit: 1.0s
Memory limit: 256M

Author:
Problem type

As an avid programmer, Carson likes to live by the following phrase:

"Eat, sleep, code, repeat."

However, sometimes he does one task more than the others. When doing a self-assessment on his efficiency during a specific day, he has developed the following formula to measure his productivity.

The formula is defined as ESC, where E, S, and C are the number of hours in the day used on eating, sleeping, and coding respectively. The sum of these three activities must be equal to the number of hours he has during that day. Since Carson does not like to switch tasks in the middle of an hour, the amount of time spent on each task must be an integer amount of hours.

As an active learner, Carson has D days where he would like to know the max productivity he could've gotten with Hi hours. Help him out!

Constraints

For this problem, you will be required to pass all the samples in order to receive any points. In addition, you must pass all previous subtasks to earn points for a specific subtask.

For all subtasks:

1D10000
3Hi106

Subtask 1 [10%]

D=1
3Hi100

Subtask 2 [20%]

D=1
3Hi2000

Subtask 3 [30%]

D=1

Subtask 4 [40%]

No additional constraints.

Input Specification

The first line contains a single integer D, the number of questions.

The next D lines describe Carson's questions. The ith line contains an integer Hi, asking for the max productivity he could've gotten with Hi hours.

Output Specification

Output D lines, with the ith line describing the max productivity score Carson could've gotten with Hi hours. Note that a 64-bit integer may be required to print the answer. In C++, this can be done with long long. In Java, this can be done with long. In Python, the standard int will suffice.

Sample Input 1

Copy
1
7

Sample Output 1

Copy
12

Sample Explanation 1

For the first and only question 2 hours of eating, 3 hours of sleeping, and 2 hours of coding can get Carson a score of 232=12.


Comments

There are no comments at the moment.