-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1196B.cpp
More file actions
37 lines (36 loc) · 849 Bytes
/
1196B.cpp
File metadata and controls
37 lines (36 loc) · 849 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include<bits/stdc++.h>
#define intl long long
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
intl n,k;
cin>>n>>k;
intl a[n];
for(intl i=0;i<n;i++){
cin>>a[i];
}
vector<intl>ans;
intl su=0;
for(intl i=0;i<n;i++){
if(ans.size()==k-1){
for(intl j=i;j<n;j++)su+=a[j];
break;
}
su+=a[i];
if(su%2){
ans.push_back(i+1);
su=0;
}
}
// cout<<su<<" ppp\n";
if(!(su%2) || ans.size()!=k-1){
cout<<"No\n";
continue;
}
ans.push_back(n);
cout<<"Yes\n";
for(intl i=0;i<ans.size();i++)cout<<ans[i]<<" ";cout<<"\n";
}
}