Croc Champ 2013 - Round 1


A. SMSC
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
1 1
2 1
Output
3 1
Input
1
1000000 10
Output
1000010 10
Input
3
3 3
4 3
5 3
Output
12 7
----------------------------------------------------------------------------------------------------
B. Network Topology
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4 3
1 2
2 3
3 4
Output
bus topology
Input
4 4
1 2
2 3
3 4
4 1
Output
ring topology
Input
4 3
1 2
1 3
1 4
Output
star topology
Input
4 4
1 2
2 3
3 1
1 4
Output
unknown topology
----------------------------------------------------------------------------------------------------
C. Beautiful IP Addresses
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6
0 1 2 9 8 7
Output
6
78.190.209.187
79.180.208.197
87.190.209.178
89.170.207.198
97.180.208.179
98.170.207.189
Input
1
4
Output
16
4.4.4.4
4.4.4.44
4.4.44.4
4.4.44.44
4.44.4.4
4.44.4.44
4.44.44.4
4.44.44.44
44.4.4.4
44.4.4.44
44.4.44.4
44.4.44.44
44.44.4.4
44.44.4.44
44.44.44.4
44.44.44.44
----------------------------------------------------------------------------------------------------
D. Connected Components
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6 5
1 2
5 4
2 3
3 1
3 6
6
1 3
2 5
1 5
5 5
2 4
3 3
Output
4
5
6
3
4
2
----------------------------------------------------------------------------------------------------
E. Copying Data
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 10
1 2 0 -1 3
3 1 5 -2 0
2 5
1 3 3 3
2 5
2 4
2 1
1 2 1 4
2 1
2 4
1 4 2 1
2 2
Output
0
3
-1
3
2
3
-1
----------------------------------------------------------------------------------------------------
