Harry Potter and seven horcruxes

Harry is improving his magical skills day by day and as a result even after partitioning his life into seven horcruxes Lord Voldemort is not feeling safe. Someone in his evil team has suggested him to increase the number of horcruxes hence Voldemort has increased the number of horcruxes. But Harry is not capable of destroying more than 7 horcruxes. Being a talented magician Harry knows it very well how to tackle this situation. Harry can replicate himself. But he exactly don’t know how many replications would be required to destroy those horcruxes. Given the number of horcruxes X your task is to calculate the number of Harrys required so as to destroy all horcruxes when each harry can destroy 7 horcruxes.

Input

First line of input is an integer T denoting the number of test cases. Next T line contains an integer X denoting the number of horcruxes Voldemort has.

Output

For each test case, your code should print the minimum number of clones required to destroy X horcruxes. Answer each test case in a new line.

Constraints-

1<=T<=1000
1<=X<=2000

Time limit- 1 second

Sample Input

2
78
42

Sample Output

12
6

the answer is ceil(x/7)

Yes, the answer is ceil(x/7), but this question is invalid.

Voldemort’s soul was already too fragile to keep splitting it up, so he could not have had more than 7 horcruxes.

Additionally, Harry has no power to replicate himself. The only way he could replicate himself is maybe by using time-turners, but those were destroyed in the 5th book.

1 Like

Tell me how many questions on codechef are ‘valid’ :wink:

1 Like
//