# Problem - 1

### Problem --

### A particular month has 30 days, numbered from 1 to 30.  
Day 1 is a Monday, and the usual 7-day week is followed.  
So day 2 is Tuesday, day 3 is Wednesday, and so on.

### Every Saturday and Sunday is a holiday.  
There are *N* festival days, which are also holidays.  
**Note -** that a festival day can occur on a Saturday or Sunday.

### Given the dates of the festivals. Determine the total number of holidays in this month.

Code --

// I have written this code, but it's not working. I can't figure the problem out. Please help me.

#**include** &lt;bits/stdc++.h&gt;

**using** **namespace** std;

int **main**()

{

int t;

cin &gt;&gt; t;

**while**(t--)

{

int N;

cin &gt;&gt; N;

int A\[N\],total\_sat\_sun =0, total\_holiday=0;

**for**(int i=0; i &lt; N; i++) { cin &gt;&gt; A\[i\]; }

**for**(int i =1; i&lt;=30; i++) *// counting total saturday & sunday*

{

**if**(i%7 == 0 || i%7 == 6) *// checking if it's sunday*

{ total\_sat\_sun+=1; }

}

sort(A, A+N); *//sorting the festival days*

total\_holiday+=total\_sat\_sun; *//Sundays and Saturdays are also holidays*

**for**(int j=0; j&lt;N; j++)

{

**if**(A\[j\]%7 != 0 || A\[j\]%7 != 6) total\_holiday++; *//checking if the festival day is Saturday/sunday*

}

cout&lt;&lt;total\_holiday&lt;&lt;endl;

}

**return** 0;

}
