Codechef•Jun 25, 2025
Dracula Eats
Hazrat Ali
Codechef
Dracula dines at a mysterious restaurant that changes its spooky menu daily. He particularly enjoys what they serve on Tuesday.
Today is Monday, so he wishes to calculate how many times he can indulge in his favourite menu in the next NN days (including today) before Halloween.
Note that Dracula follows the standard 77-day calendar, with Tuesday immediately following Monday.
Input Format
- The first line of input will contain a single integer TT, denoting the number of test cases.
- The only line of each test case contains a single integer NN, denoting the number of spooky days.
Output Format
For each test case, output on a new line the number of times Dracula would have had his favorite meal after NN days.
Constraints
- 1≤T≤1000
- 1≤N≤1000
Sample 1:
Input
4 1 10 15 16
Output
0 2 2 3
Solution
T = int(input())
for _ in range(T):
N = int(input())
if N < 2:
print(0)
else:
count = 1 + (N - 2) // 7
print(count)