Codeforces Testing Round 5


A. Subtractions
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
4 17
7 987654321
Output
8
141093479
----------------------------------------------------------------------------------------------------
B. Dominoes
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
1 2
2 4
2 4
6 4
2 1
Output
2 -
1 -
5 -
3 +
4 -
----------------------------------------------------------------------------------------------------
C. Berland Traffic
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
3
1 2 2
1 2 4
2 1 1000
Output
6.00000
2.00000
2.00000
-2.00000
Input
7
11
1 2 7
1 2 7
1 3 7
1 4 7
2 3 7
2 5 7
3 6 7
4 7 7
5 4 7
5 6 7
6 7 7
Output
13.00000
2.00000
2.00000
3.00000
6.00000
1.00000
3.00000
4.00000
7.00000
1.00000
2.00000
6.00000
----------------------------------------------------------------------------------------------------
