Wcipeg 2018 ECOO Qualifier

Billows™

For a living, Bincent runs a company which produces snacks. One of his most popular products are Billows™, for which he constantly receives custom orders.

Usually, the accountants he employs around the country are responsible for processing custom orders. However, the Accountants' Committee for Safe Labour (ACSL) has initiated a country-wide strike. As a result, Bincent must personally review the orders placed to each factory, and calculate the amount of material that each factory requires to complete all orders.

Conveniently, each size is defined by the amount of material required. Can you help Bincent find the amount of material required at each factory?

Input Format:

Line 1: F, the number of factories Each case consists of 3 lines: An integer N, the number of different sizes produced at the factory The integers a1, a2, … an, each representing a different size. The integers b1, b2, … bn, each representing the number of orders for size ai. All integers provided as input will be between 0 and 10000, inclusive.

Output Format:

The output should have F integers on separate lines, each integer representing the amount of material which must be transported to each factory.

Sample Input:

2
3
1 2 5
5 2 0
5
1 10 100 1000 10000
1 3 7 1 9

Sample Output:

9
91731

All Submissions
Best Solutions


Point Value: 3
Time Limit: 2.00s
Memory Limit: 256M
Added: Jan 28, 2018
Author: kxoraxe

Languages Allowed:
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3

Comments (Search)

I have no idea why my code isn't working. I've tested most of the syntax and it should all be valid in 3.2.3, but I'm still continuously getting RE?

no really sure whats going on here, but it may be either due to ```raw_input``` error or the type of python you are using, try using raw_input and maybe python 2

Do not read input in this fashion. It is far too easy to make a mistake while performing manual string processing. Instead, use split().