#include<bits/stdc++.h>
using namespace std;
const int N=25;
int n,m;
int a[N];
int q[N];
int ans;
void dfs(int idx,int rest,int num){
if(rest==0){
ans=min(ans,num);
return ;
}
if(idx==0) return ;
if(q[idx]<rest) return ;
if(q[idx]==rest){
ans=min(ans,num+id...