๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
9.63K subscribers
5.61K photos
3 videos
95 files
10.6K links
๐ŸšฉMain Group - @SuperExams
๐Ÿ“Job Updates - @FresherEarth

๐Ÿ”ฐAuthentic Coding Solutions(with Outputs)
โš ๏ธDaily Job Updates
โš ๏ธHackathon Updates & Solutions

Buy ads: https://telega.io/c/cs_algo
Download Telegram
โœ…โœ…โœ…Minimum Array Product

Problem Statement
The program must accept values for two positive integer arrays of size N. The program must print the minimum sum S possible when a value in the first array is multiplied with a value in the second array. If a value is already used for multiplication then the value cannot be used again.

Boundary Condition(S)
1 <= N <= 100
1 <= Each Integer Value in Array <= 100

Input Format
The first line contains N.
The second line contains N positive integer values separated by a space.
The third line contains N positive integer values separated by a space.

Output Format
The first line contains S.

Example Input/Output 1

Input

3
5 6 10
8 15 9
Output

209
Explanation

The minimum sum is obtained for 10*8 + 6*9 + 5*15.
Example Input/Output 2

Programming Language: Python 3 Language

n=int(input())
l1=sorted(list(map(int,input().split())))[::-1]
l2=sorted(list(map(int,input().split())))
s=0
for i in range(n):
s+=l1[i]*l2[i]
print(s)