public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String line = "";
		int times = 1;
		while ((line = in.readLine()) != null && line.length() != 0) {
			if (line.trim().equals("-1"))
				break;
			totalDis = Double.parseDouble(line.trim());
			double[] d = retDoubles(in.readLine());
			galCapacity = d[0];
			milesPerGal = d[1];
			initialCost = d[2] * 100;
			int amountStations = (int) d[3];
			stations = new Station[amountStations + 1];
			stations[0] = new Station(0, initialCost);
			for (int i = 1; i <= amountStations; i++)
				stations[i] = new Station(in.readLine().trim());
			min = Double.MAX_VALUE;
			back(initialCost, 0);
			System.out.println("Data Set #" + times++);
			System.out.printf(Locale.US, "minimum cost = $%.2f\n", min / 100.0);
		}
	}