Binary Operation

Time Limit: 2000ms
Memory Limit: 32768KB
This problem will be judged on HDU. Original ID: 3754
64-bit integer IO format: %I64d      Java class name: Main

Input

The input begins with an integer T. The next T blocks each represents a case.

Sample Input

1
0 1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9 0
2 3 4 5 6 7 8 9 0 1
3 4 5 6 7 8 9 0 1 2
4 5 6 7 8 9 0 1 2 3
5 6 7 8 9 0 1 2 3 4
6 7 8 9 0 1 2 3 4 5
7 8 9 0 1 2 3 4 5 6
8 9 0 1 2 3 4 5 6 7
9 0 1 2 3 4 5 6 7 8
0 10

Sample Output

15

Source

Language: 
Theme: 
Share Code? 

Powered by NB231 | Current Style: .