please check this problem answer :

#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 cities, roads, road1, road2;

long i, j, k, scinario = 0;

long source, des, totalPassengers;

scanf( "%ld%ld", &cities, &roads );

while( cities && roads )

{

init( roads );

for( i = 0; i < roads; ++i ){

scanf( "%ld%ld", &road1, &road2 );

scanf( "%ld", &passengers[road1][road2] );

passengers[road2][road1] = passengers[road1][road2];

}

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 )));

scanf( "%ld%ld", &cities, &roads );

}

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 cities, roads, road1, road2;

long i, j, k, scinario = 0;

long source, des, totalPassengers;

scanf( "%ld%ld", &cities, &roads );

while( cities && roads )

{

init( roads );

for( i = 0; i < roads; ++i ){

scanf( "%ld%ld", &road1, &road2 );

scanf( "%ld", &passengers[road1][road2] );

passengers[road2][road1] = passengers[road1][road2];

}

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 )));

scanf( "%ld%ld", &cities, &roads );

}

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( long roads ) {

long i, j;

for( i = 1; i <= roads; ++i )

for( j = 1; j <= roads; ++j )

passengers[i][j] = NEGINF;

}

int main()

{

long cities, roads, road1, road2;

long i, j, k, scinario = 0;

long source, des, totalPassengers;

scanf( "%ld%ld", &cities, &roads );

while( cities && roads )

{

init( roads );

for( i = 0; i < roads; ++i ){

scanf( "%ld%ld", &road1, &road2 );

scanf( "%ld", &passengers[road1][road2] );

passengers[road2][road1] = passengers[road1][road2];

}

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 )));

scanf( "%ld%ld", &cities, &roads );

}

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 cities, roads, road1, road2;

long i, j, k, scinario = 0;

long source, des, totalPassengers;

scanf( "%ld%ld", &cities, &roads );

while( cities && roads )

{

init( roads );

for( i = 0; i < roads; ++i ){

scanf( "%ld%ld", &road1, &road2 );

scanf( "%ld", &passengers[road1][road2] );

passengers[road2][road1] = passengers[road1][road2];

}

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 )));

scanf( "%ld%ld", &cities, &roads );

}

return 0;

}

### Recently Asked Questions

- A credit card company classifies its customers by gender and location of residence. The research department has gathered data from a random sample of 1768

- There are two firms that produce large commercial airplanes, namely, Boeing and Airbus. Boeing and Airbus have different flight control systems, with many

- Consider three binary variables A,B,C. Using the vertical axis for Y and the horizontal axis for X, consider plotting the log odds for A given each combination