# Codeforces Round #364 (Div. 2):

#include <bits/stdc++.h>
using namespace std;
const int N = 105;
int num[N];
bool vis[N];
int n;

int main(){
ios::sync_with_stdio(false);
cin.tie(0);
cin >> n;
int sum = 0;
for (int i=0; i<n; ++i){
cin >> num[i];
sum += num[i];
}
sum /= (n/2);
for (int i=0; i<n; ++i)
if (!vis[i]){
vis[i] = true;
for (int j=i+1; j<n; ++j)
if (!vis[j] && num[i]+num[j]==sum){
cout << i+1 << " " << j+1 << endl;
vis[j] = true;
break;
}
}
return 0;
}

#include <bits/stdc++.h>
using namespace std;
int n;
vector<pair<int, int> > cards;
//-----------------------------------------------------------------
int main()
{
scanf("%d", &n);
for(int i=0; i<n; i++){
int a;
scanf("%d", &a);
cards.push_back(make_pair(a, i + 1));
}
sort(cards.begin(), cards.end());

for(int i=0; i<n/2; i++) {
int j = n-1-i;
printf("%d %d\n", cards[i].second, cards[j].second);
}
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n, m;
set<int> s1, s2;

int main(){
ios::sync_with_stdio(false);
cin.tie(0);
cin >> n >> m;
ll t = 1LL*n*n;
int a, b, c=0;
while (m--){
cin >> a >> b;
s1.insert(a);
s2.insert(b);
ll ans = t-1LL*s1.size()*n-1LL*(n-s1.size())*s2.size();
if (c)cout << " ";
cout << ans;
++c;
}
cout << endl;
return 0;
}

#include <bits/stdc++.h>
#define ll __int64
using  namespace  std;
const int inf=0x3f3f3f3f;
int n;
char  s[100005];
int  a[100005];

void  solve(){
set<int>all;
for(int i=0; i<n; i++){
all.insert(a[i]);
}
int len=all.size();
//    printf("len=%d\n",len);

int s=0,t=0,num=0;
map<int,int>cnt;
int res=n;
for(;;){
while(t<n&&num<len){
if(cnt[a[t++]]++==0){
num++;
}
}
//        printf("s=%d t=%d\n",s,t);
if(num<len)break;
res=min(res,t-s);
if(--cnt[a[s++]]==0){
num--;
}
}
printf("%d\n",res);
}

int  main(){
//    freopen("in.txt", "r", stdin);
//    freopen("out.txt", "w", stdout);
scanf("%d",&n);
getchar();
for(int i=0; i<n; i++){
scanf("%c",&s[i]);
a[i]=s[i]-'A';
//            printf("a[%d]=%d\n",i,a[i]);
}
solve();

return 0;
}

CF拿初中题来考，不要被吓得不敢做。。。。

#include <bits/stdc++.h>
#define ll __int64
#define pr(x) cout << #x << "= " << x << "  "
#define pl(x) cout << #x << "= " << x << endl;
using  namespace  std;
const int inf=0x3f3f3f3f;
int n, k;
double l, v1, v2;

int  main(){
//    freopen("in.txt", "r", stdin);
//    freopen("out.txt", "w", stdout);
while (cin >> n >> l >> v1 >> v2 >> k) {
double a = (v2 - v1) /(v2 + v1) * v1 + v1;
double b = (k + n - 1) / k - 1;
double t2 = l / (a * b + v2);
double t1 = (l - v2 * t2) / v1;
printf("%.14f\n", t1 + t2);
}
return 0;
}