The Dot Product, Directly
Harbourview Logistics prices a crate by what it weighs. The picking system files two lines for every crate: how many of each part went in, and what one of that part weighs. The two lines run in the same part order, so the third figure on one line and the third on the other describe the same part. The crate itself weighs nothing worth counting, and the dispatch label carries a single number.
Task: Print the crate's total weight.
Input
Three lines. The first holds an integer n, the number of distinct parts in the crate. The second holds n counts separated by single spaces. The third holds n unit weights, in the same part order.
Output
One line holding the crate's total weight as a plain integer. Every graded crate comes to a whole number.
Example:
Input:
3
1 2 3
4 5 6
Output:
32
Sign in to solve this problem
Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.
Sign in