Skip to content

Commit

Permalink
Create Least Product.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
animshamura authored Jan 6, 2024
1 parent fa008a7 commit 8aee66c
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Least Product.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include<bits/stdc++.h>
using namespace std;
int main() {
int t,n,ai,c1,c2;
cin>>t;
while(t--){
cin>>n;
c1=0, c2=0;
for(int i = 1; i <= n; i++){
cin>>ai;
if(ai==0) c1=1;
if(ai<0)c2++;
}
if(c1||c2%2) cout<<0<<endl;
else cout<<1<<endl<<1<<" "<<0<<endl;
}
}

0 comments on commit 8aee66c

Please sign in to comment.