Hero
题号:NC15336
时间限制:C/C++/Rust/Pascal 3秒,其他语言6秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

Today, Jelly gets N items. The ith item has two attributes which are Ai and Bi.                  

For the ith item, we have:

Now, Jelly wants to calculate:

He has too little time, so he asks you for help.

输入描述:


The first line contains an integer T, where T is the number of test cases. T test cases follow. 
For each test case, the first line contains one integer N, where N is the number of items. 
The second line contains N integers A1, A2, ... , AN.
The third line contains N integers B1, B2, ..., BN.

• 1 ≤ T ≤ 105.
• 1 ≤ N ≤ 105.
• −104 ≤Ai ≤104.
• −105 ≤Bi ≤105.
• the sum of N in all test cases doesn’t exceed 106.

  


输出描述:

For each test case, output one line containing “Case #x: y”, where x is the test case number (starting
from 1) and y is the answer.
示例1

输入

复制
2
5
2 1 -1 0 -2
2 1 -1 0 -2
1
0
0

输出

复制
Case #1: 163509529
Case #2: 0

备注:

For the first case, f1 =2, f2 =2, f3 =2, f4 =0, f5 =2.