Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- #define ll long long
- #define fast ios_base::sync_with_stdio(0),cin.tie(NULL)
- int main()
- {
- fast;
- ll t;
- cin>>t;
- while(t--)
- {
- ll n;
- cin>>n;
- vector<ll>odd,even;
- ll i,cnt=0;
- for(i=0;i<n*2;i++)
- {
- ll x;
- cin>>x;
- if(x%2)odd.push_back(i+1);
- else even.push_back(i+1);
- }
- //sort(odd.begin(),odd.end());
- //sort(even.begin(),even.end());
- if(odd.size()>=2)for(i=0;i<odd.size()-1 && cnt<n-1;i+=2)
- {
- cout<<odd[i] <<" "<<odd[i+1]<<endl;
- cnt++;
- }
- if(even.size()>=2)for(i=0;i<even.size()-1&& cnt<n-1;i+=2)
- {
- cout<<even[i] <<" "<<even[i+1]<<endl;
- cnt++;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement