#include "stdio.h"
#include"stdlib.h"
#include"iostream"
using namespace std;
/*
分析:符合要求的桌子数量可能比人数批次少,那么应该从m批次中选出部分批次已达到最大收益。
思路:1、把每张桌子可容纳最大人数进行从小到大排序。假设n张桌子对应的a为a[0]、a[1]....a[n-1]
得到a[0]<=a[1]<=a[2]<=...<=a[n-1]
2、从a[0]开始,从b[0]...b[m],c[0]...c[m]中选择一个符合批次人数小于a[0]的最大消费金额。并保存到max矩阵中,并记录标志flag。
依次上述步骤。
3、对max矩阵中的数据进行求和得到sum。打印sum。
*/
void main(){
int n,m;
int a[50000]={0};
int b[50000]={0};
int c[50000]