Answer to Question #302747 in C for Hahagah

Question #302747

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


1
Expert's answer
2022-02-26T11:32:21-0500
#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;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS