#include using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x>C>>N; FOR(i,N) cin>>A[i]; FOR(i,C+1) dp[i]=101010; dp[0]=0; FOR(i,N) { FOR(j,C+1) dp[j+A[i]]=min(dp[j+A[i]],dp[j]+1); } if(dp[C]>101000) dp[C]=-1; cout<