Two Arrays And Sum Of Functions

medium
https://codeforces.com/contest/1165/problem/E

Input Format

Check Link

Output Format

Check Link

Constraints

Check Link

Example

Input
5
1 8 7 2 4
9 7 2 9 3
Output
646
Previous
Permutation By Sum
Next
Lcm

Related Questions