-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path10050.txt
More file actions
44 lines (41 loc) · 655 Bytes
/
10050.txt
File metadata and controls
44 lines (41 loc) · 655 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//Ë®Ìâ
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <queue>
#include <stack>
#define MAXN 200
using namespace std;
int parties[MAXN];
int main(int argc, char* argv[])
{
int n,i,j,k,m,temp,t,p;
freopen("input.txt","r",stdin);
int n_count=1;
scanf("%d",&t);
while (t--)
{
memset(parties,0,sizeof(parties));
scanf("%d",&n);
scanf("%d",&p);
for (i=0;i<p;i++)
scanf("%d",&parties[i]);
int count=0;
for (i=1;i<=n;i++)
{
if(i%7==6||i%7==0)
continue;
for (j=0;j<p;j++)
{
if(i%parties[j]==0)
{
count++;
break;
}
}
}
printf("%d\n",count);
}
return 0;
}