#C6089. Lowest Total Price
Lowest Total Price
Lowest Total Price
You are given two lists of prices for N products from two different stores. For each product, you must choose the lower price between the two stores. The problem can be summarized by the formula:
\( total = \sum_{i=1}^{N} \min(p_i^1, p_i^2) \)
Your task is to compute and print the lowest possible total price for buying all products.
inputFormat
The input is given via standard input (stdin) as follows:
- The first line contains an integer (N), the number of products.
- The second line contains (N) space-separated integers, representing the prices of the products in the first store.
- The third line contains (N) space-separated integers, representing the prices of the products in the second store.
outputFormat
Print a single integer to standard output (stdout) representing the lowest total price required to purchase all products.## sample
3
10 20 30
15 25 10
40