#include "stdafx.h"
#include <iostream>
#include <fstream>
using namespace std;
const int max_n = 100;//程序支持的最多金礦數(shù)
const int max_people = 10000;//程序支持的最多人數(shù)
int n;//金礦數(shù)
int peopleTotal;//可以用于挖金子的人數(shù)
int peopleNeed[max_n];//每座金礦需要的人數(shù)
int gold[max_n];//每座金礦能夠挖出來(lái)的金子數(shù)
int maxGold[max_people][max_n];//maxGold[j]保存了i個(gè)人挖前j個(gè)金礦能夠得到的最大金子數(shù),等于-1時(shí)表示未知
//獲得在僅有people個(gè)人和前mineNum個(gè)金礦時(shí)能夠得到的最大金子數(shù),注意“前多少個(gè)”也是從0開始編號(hào)的
int GetMaxGold(int people, int mineNum)
{
//申明返回的最大金子數(shù)
int retMaxGold;