Advertisement
Saleh127

cf 1433E

Oct 21st, 2020
65
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define ll long long
  4. #define test int t; cin>>t; for(int cs=1;cs<=t;cs++)
  5. int main()
  6. {
  7. ios_base::sync_with_stdio(0);
  8. cin.tie(0);
  9. cout.tie(0);
  10.  
  11. test
  12. {
  13.  
  14. ll a[50000],c,d=-100,e,f,i,j,k,l;
  15. cin>>c;
  16. for(i=1;i<=c;i++)
  17. {
  18. cin>>a[i];
  19. if(d<0 && a[i]!=a[1])
  20. {
  21. d=i;
  22. }
  23. }
  24. if(d<0) cout<<"NO"<<endl;
  25. else
  26. {
  27. cout<<"YES"<<endl;
  28. for(i=2;i<=c;i++)
  29. {
  30. if(a[i]!=a[1]) cout<<1<<" "<<i<<endl;
  31. else cout<<d<<" "<<i<<endl;
  32. }
  33.  
  34.  
  35. }
  36. }
  37.  
  38.  
  39. return 0;
  40. }
  41.  
Advertisement
RAW Paste Data Copied
Advertisement