0% found this document useful (0 votes)
6 views2 pages

Problem A Cloud System: Time Limit: Mem Limit

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

Problem A Cloud System: Time Limit: Mem Limit

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

The 2021 ICPC Vietnam Southern Provincial

Programming Contest
University of Science, VNU-HCM
December 06th, 2021

Problem A
Cloud System
Time Limit: 3 seconds
Mem limit: 512 Megabytes
Ho Chi Minh University of Science has just build a new cloud computing system to run
experiences of their research related of deep-learning.
The system consists of N servers (numbered 1to N ). Each pair of servers are connected by at
most 1cable (possibly 0 ).
The cable connecting server u and server v has the transmitting capacity of C u ,v megabits per
nanosecond.
Let's define F u,v the data transfer rate between server u and server v . To transfer data from server
u to server v , the data can be splitted into multi parts and transfer via multiple routes.
For example, to transfer data from server 1 to server 4, data can be split
into 3 parts and transferred via 3 following routes:
 1 - 4 (30 Mb per nanosecond)
 1 - 3 - 4 (20 Mb per nanosecond)
 1 - 2 - 4 (10 Mb per nanosecond)
so the transfer rate from 1 to 4 is 60 Mb per nanosecond or F =60 .
1,4

You are given the configuration of the network and the capacity of the cables, your task is to
compute F .

Input
The input starts with T - the number of test cases. Then T test cases follow.
Each test case starts with N the number of servers in the network ( N ≤200 ).
In the next N lines, each line contains N integers C u,v (0≤Cuv≤10000).

It is guaranteed that C u ,v =C v , u and C u,u=0 .


Note: The sum of N in the input does not exceeded 1000.

Output
For the t th test case, print "Case #t:". The next N lines, print the N × N matrix F .

The 2021 ICPC Vietnam Southern Provincial 1|Page


The 2021 ICPC Vietnam Southern Provincial
Programming Contest
University of Science, VNU-HCM
December 06th, 2021

Sample input Sample output


2 Case #1:
4 0 60 60 60
0 50 20 30 60 0 60 60
50 0 0 10 60 60 0 90
20 0 0 70 60 60 90 0
30 10 70 0 Case #2:
4 0 10 0 0
0 10 0 0 10 0 0 0
10 0 0 0 0 0 0 10
0 0 0 10 0 0 10 0
0 0 10 0

The 2021 ICPC Vietnam Southern Provincial 2|Page

You might also like