Problem R
Cities
Languages
en
sv
In a far away kingdom, there are
For any two cities
Input
The first line contains the integers
The two lines contains the
Output
Output the number of pairs of cities that have exactly
Scoring
Your solution will be tested on a set of test groups, each worth a number of points. To get the points for a test group you need to solve all test cases in the test group.
Group |
Points |
Constraints |
|
|
|
|
|
|
|
|
|
|
|
No additional constrsaints. |
Explanation of sample 1
Let the kingdom have
The following 4 pairs have a single road between them:
The following 4 pairs have two roads between them:
The following 2 pairs have three roads between them:
This means that if for
Sample Input 1 | Sample Output 1 |
---|---|
5 2 0 0 0 3 1 2 4 4 |
4 |