please check this problem of program challenges book

#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

- Determine the identity of an unknown metal if 1.00 g of this metalreacts with excess acid according to the following equation toproduce 374 milliliters of H 2

- 1.Explanation for each step in the accounting cycle: Transaction: The first and foremost step in the accounting cycle is transaction.To record in books of

- Could anyone please explain step-by-step how to complete nuclear equation for the following: a) tritium, 3Hundergoes β decay b) 242Puundergoes α-particle