Akash and Missing Class Codechef Solution | MARCH CHALLENGE
Akash and Missing Class CodeChef Solution:
Akash loves going to school, but not on weekends.
A week consists of 77 days (Monday to Sunday). Akash takes a leave every Saturday.
If a month consists of NN days and the first-day of the month is Monday, find the number of days Akash would take a leave in the whole month.
Input Format
- First line will contain TT, the number of test cases. Then the test cases follow.
- Each test case contains a single line of input, one integer NN — the number of days in the month.
Output Format
For each test case, output in a single line, the number of days Akash would take a leave in the whole month.
Constraints
- 1≤T≤1001≤T≤100
- 1≤N≤1091≤N≤109
Subtasks
- Subtask 1 (30 points) : 1≤N≤1001≤N≤100
- Subtask 2 (70 points) : Original Constraints
Sample Input 1
4
5
6
8
22
Sample Output 1
0
1
1
3
Explanation
Test case 11: The month consists of 55 days (Monday, Tuesday, Wednesday, Thursday, and Friday). Since there are no Saturdays, Akash would go to school every day. Thus, he takes a leave for 00 days.
Test case 22: The month consists of 66 days (Monday, Tuesday, Wednesday, Thursday, Friday, Saturday). Akash takes a leave only on Saturday. Thus, he takes a leave for 11 day.
Test case 33: The month consists of 88 days (Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday, Monday). Akash takes a leave only on Saturday. Thus, he takes a leave for 11 day.
Akash and Missing Class SOLUTION
C++
Join our telegram group for codes.
Java
Will be Updated soon
Python
Will be Updated soon
Read More Post Here