-
Notifications
You must be signed in to change notification settings - Fork 181
/
D.cpp
41 lines (41 loc) · 840 Bytes
/
D.cpp
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
38
39
40
41
#include <bits/stdc++.h>
using namespace std;
int main()
{
long long t;
cin>>t;
while(t--)
{
long long n;
cin>>n;
vector<long long> v(n);
for(long long i=0;i<n;i++)
cin>>v[i];
int found=0;
long long compare=v[0],ind1=0,ind2=-1;;
for(long long i=1;i<n;i++)
{
if(compare!=v[i])
{
found=1;
ind2=i;
break;
}
}
if(found==0)
{
cout<<"NO\n";
continue;
}
cout<<"YES\n";
cout<<ind1+1<<" "<<ind2+1<<"\n";
for(long long i=1;i<n;i++)
{
if(v[i]!=v[ind1]&&i!=ind2)
cout<<ind1+1<<" "<<i+1<<"\n";
else if(v[i]!=v[ind2])
cout<<ind2+1<<" "<<i+1<<"\n";
}
}
return 0;
}