-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbicycle-temp.cpp
More file actions
45 lines (43 loc) · 802 Bytes
/
Copy pathbicycle-temp.cpp
File metadata and controls
45 lines (43 loc) · 802 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
45
#include <iostream>
using namespace std;
int main()
{
int n, m, a[64], b[64], i, j, ma = 0, br = 0;
cin >> n;
for (i = 0; i < n; i++)
{
cin >> a[i];
}
cin >> m;
for (i = 0; i < m; i++)
{
cin >> b[i];
}
for (i = 0; i < n; i++)
{
for (j = 0; j < m; j++)
{
if (b[j] % a[i] == 0)
{
if (b[j] / a[i] > ma)
{
ma = b[j] / a[i];
}
}
}
}
for (i = 0; i < n; i++)
{
for (j = 0; j < m; j++)
{
if (b[j] % a[i] == 0)
{
if (b[j] / a[i] == ma)
{
br++;
}
}
}
}
cout << br << endl;
}