document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. const int SIZE = 101;
  4. string s[SIZE],T;
  5. int main(){
  6.     ios_base::sync_with_stdio(false);
  7.     int n;
  8.     cin>>n;
  9.     for(int i=1;i<=n;i++)cin>>s[i];
  10.     cin>>T;
  11.     vector<pair<int,int> >an;
  12.     for(int i=1;i<=n;i++)
  13.         for(int j=i+1;j<=n;j++){
  14.             if(s[i]+s[j]==T||s[j]+s[i]==T)an.push_back(make_pair(i,j));
  15.         }
  16.     printf("%d\\n",(int)an.size());
  17.     for(int i=0;i<an.size();i++)printf("%d %d\\n",an[i].first,an[i].second);
  18. }
');