#include<bits/stdc++.h>
#include <iostream>
using namespace std;
template<class Typew,class Typep>
class Knap
{
public:
Typep Bound(int i);
void Backtrack(int i);
Typew c;
int n;
Typew *w;
Typep *p;
Typew cw;
Typep cp;
Typep bestp;
};
template<class Typew,class Typep>
Typep Knapsack(Typep p[],Typew w[],Typew c,int n);
template <class Type>
inline void Swap(Type &a,Type &b);
template<class Type>
void BubbleSort(Type a[],int n);
int main()
{
int n;
int c = 7;
cout<<"请输入物品数目:";
cin>>n;
int p[n+1];
p[0]=0;
int w[n+1];
w[0