#include #include using namespace std; int main(){ int T, n; cin >> T >> n; vector t(n); for(int i = 0; i < n; i++) cin >> t[i]; vector dp(1<>i&1) dp[s] += t[i]; } if(dp[s] <= T) dp[s] = 1; else dp[s] = n; } dp[0] = 0; for(int s = 1; s < 1<