# Evacuation plan

## Description

Discuss (14 comments)
This puzzle is a tribute to all the people who suffered from the earthquake in Japan. The goal of this puzzle is, given a network of road and locations, to determine the maximum number of people that can be evacuated.

The people must be evacuated from

The output should contain only 1 line, giving the maximal number of people that can be evacuated per hour.

For the previous example, the expected answer is:

The people must be evacuated from

**evacuation points**to**rescue points**. The list of road and the number of people they can carry per hour is provided.# Input Specifications

Your program must accept one and only one command line argument: the input file. The input file is formatted as follows:- the first line contains 4 integers
**n r s t**

*n*is the number of locations (each location is given by a number from 0 to*n*-1)*r*is the number of roads*s*is the number of locations to be evacuated from (evacuation points)*t*is the number of locations where people must be evacuated to (rescue points)

- the second line contains
*s*integers giving the locations of the evacuation points - the third line contains
*t*integers giving the locations of the rescue points - the
*r*following lines contain to the road definitions. Each road is defined by 3 integers**l1 l2 width**

where*l1*and*l2*are the locations connected by the road (roads are one-way) and*width*is the number of people per hour that can fit on the road

5 5 1 2 0 3 4 0 1 10 0 2 5 1 2 4 1 3 5 2 4 10

# Output Specifications

The output of your program must be printed to the standard output.The output should contain only 1 line, giving the maximal number of people that can be evacuated per hour.

For the previous example, the expected answer is:

14

© CoderCharts - All Rights Reserved

Type | Puzzle | Pass | 161 | Fail | 198 | ||

Scoring | Language | Level | Medium | Points | 900 | ||

Tags | maximization, optimization, path search, recursion |

**Source code editor**

## Unit Tests

Name | CPU Unit | Memory Unit |
---|---|---|

## NeighborhoodThis test has 10 locations (2 evacuation points, 3 rescue areas) and 80 roads |
||

## VillageThis test has 100 locations (1 evacuation point, 10 rescue areas) and 800 roads |
||

## CityThis test has 100 locations (2 evacuation points, 20 rescue areas) and 8000 roads |
||

## RegionThis test has 500 locations (50 evacuation points, 10 rescue areas) and 1000 roads |
||

## CountryThis test has 1000 locations (10 evacuation points, 100 rescue areas) and 2000 roads |
||

## ContinentThis test has 1000 locations (3 evacuation points, 40 rescue areas) and 15000 roads |

Confirm that you want to switch languages

Your current edits will be lost.

Confirm that you wish to load a previous submission

Your current edits will be lost.