#K9981. Minimum Adjustments

    ID: 39150 Type: Default 1000ms 256MiB

Minimum Adjustments

Minimum Adjustments

Given (n) enclosures, you are provided with two arrays: (\textit{delivered}) and (\textit{required}). The task is to compute the minimum number of adjustments required so that every enclosure receives the correct meal portion. The adjustment for the (i)-th enclosure is calculated as (|\textit{delivered}_i - \textit{required}i|), and the final answer is given by [ \sum{i=1}^{n} |\textit{delivered}_i - \textit{required}_i|].

Example:
Input:
3
5 7 6
6 8 5
Output:
3

inputFormat

The input is provided via standard input (stdin) and consists of three lines. The first line contains an integer (n), the number of enclosures. The second line contains (n) space-separated integers representing the delivered portions. The third line contains (n) space-separated integers representing the required portions.

outputFormat

Output a single integer to standard output (stdout) representing the minimum number of adjustments required.## sample

3
5 7 6
6 8 5
3