Input
The first line of input consists of an
integer- size 1, representing the size
of the first list (N).
The second line consists of N space-
separated characters representing
the product ID for each product.
The third line consists of an integer-
size2, representing the size of the
second list (M).
The last line consists of M space
separated integers representing the
quantity for each product.
Output
Print a list of size N* M containing the
elements of the list alteggate),
Note
Both of the lists will always have the
same number of elemenos
Example
Input
3
abe
3
123
#include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int ing[n], lab[n], res[n];
for (int i = 0; i < n; i++) {
cin >> ing[i];
}
for (int i = 0; i < n; i++) {
cin >> lab[i];
}
for (int i = 0; i < n; i++) {
res[i] = lab[i] / ing[i];
}
int min = ing[0];
for (int i = 1; i < n; i++) {
if (res[i] < min)
min = res[i];
}
cout << min;
return 0;
}
Comments
Leave a comment