I get the following for the input listed above by chuzpa, but I still get a WA. Is there something wrong with my formatting or my answers? Some answers are different from others but they are still optimal.
Chain 1
Depot 1 at restaurant 2 serves restaurants 1 to 3
Depot 2 at restaurant 5 serves restaurants 4 to 5
Depot 3 at restaurant 6 serves restaurant 6
Total distance sum = 8
Chain 2
Depot 1 at restaurant 1 serves restaurant 1
Total distance sum = 0
Chain 3
Depot 1 at restaurant 2 serves restaurants 1 to 2
Total distance sum = 10000
Chain 4
Depot 1 at restaurant 1 serves restaurant 1
Depot 2 at restaurant 2 serves restaurant 2
Depot 3 at restaurant 4 serves restaurants 3 to 4
Total distance sum = 1
Chain 5
Depot 1 at restaurant 1 serves restaurant 1
Depot 2 at restaurant 2 serves restaurant 2
Depot 3 at restaurant 3 serves restaurant 3
Total distance sum = 0
Chain 6
Depot 1 at restaurant 2 serves restaurants 1 to 2
Depot 2 at restaurant 4 serves restaurants 3 to 5
Total distance sum = 3
Chain 7
Depot 1 at restaurant 2 serves restaurants 1 to 2
Depot 2 at restaurant 4 serves restaurants 3 to 5
Total distance sum = 3
Chain 8
Depot 1 at restaurant 3 serves restaurants 1 to 5
Total distance sum = 6