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

View as PDF

Submit solution

Points: 5 (partial)
Time limit: 1.0s
Java 2.0s
Python 3.0s
Memory limit: 256M

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 E \cdot S \cdot C, 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 H_i hours. Help him out!


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:

1 \le D \le 10\,000
3 \le H_i \le 10^6

Subtask 1 [10%]

D = 1
3 \le H_i \le 100

Subtask 2 [20%]

D = 1
3 \le H_i \le 2\,000

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 i^{th} line contains an integer H_i, asking for the max productivity he could've gotten with H_i hours.

Output Specification

Output D lines, with the i^{th} line describing the max productivity score Carson could've gotten with H_i 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


Sample Output 1


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 2 \cdot 3 \cdot 2 = 12.


There are no comments at the moment.