View the step-by-step solution to:

# #include &lt;stdio.h&gt; #include &lt;math.h&gt; #define MAX 102 #define NEGINF -10000 #define max(a, b) ( (a &gt; b) ? (a) : (b) ) #define min(a, b)...

#include <stdio.h>
#include <math.h>

#define MAX 102
#define NEGINF -10000

#define max(a, b) ( (a > b) ? (a) : (b) )
#define min(a, b) ( (a < b) ? (a) : (b) )

long passengers[MAX][MAX];

void init( long roads ) {
long i, j;
for( i = 1; i <= roads; ++i )
for( j = 1; j <= roads; ++j )
passengers[i][j] = NEGINF;
}
int main()
{
long i, j, k, scinario = 0;
long source, des, totalPassengers;
{
for( i = 0; i < roads; ++i ){
}
scanf( "%ld%ld%ld", &source, &des, &totalPassengers );
for( k = 1; k <= cities; ++k )
for( i = 1; i <= cities; ++i )
for( j = 1; j <= cities; ++j )
passengers[i][j] = max( passengers[i][j], min( passengers[i][k], passengers[k][j]));

printf( "Scenario #%ldnMinimum Number of Trips = %.0lfnn", ++scinario,
ceil( double(totalPassengers) / ( passengers[source][des] - 1 )));

}
return 0;
}#include <stdio.h>
#include <math.h>

#define MAX 102
#define NEGINF -10000

#define max(a, b) ( (a > b) ? (a) : (b) )
#define min(a, b) ( (a < b) ? (a) : (b) )

long passengers[MAX][MAX];

void init( int roads ) {
int i, j;
for( i = 1; i < MAX; ++i )
for( j = 1; j < MAX; ++j )
passengers[i][j] = 0;
}

int main()
{
long i, j, k, scinario = 0;
long source, des, totalPassengers;
{
for( i = 0; i < roads; ++i ){
}
scanf( "%ld%ld%ld", &source, &des, &totalPassengers );
for( k = 1; k <= cities; ++k )
for( i = 1; i <= cities; ++i )
for( j = 1; j <= cities; ++j )
passengers[i][j] = max( passengers[i][j], min( passengers[i][k], passengers[k][j]));

printf( "Scenario #%ldnMinimum Number of Trips = %.0lfnn", ++scinario,
ceil( double(totalPassengers) / ( passengers[source][des] - 1 )));

}
return 0;
}

We need you to clarify your question for our tutors!... View the full answer

### Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

### -

Educational Resources
• ### -

Study Documents

Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

Browse Documents