forked from ngthanhtrung23/CompetitiveProgramming
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathF.cpp
More file actions
33 lines (29 loc) · 677 Bytes
/
F.cpp
File metadata and controls
33 lines (29 loc) · 677 Bytes
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
#include <bits/stdc++.h>
using namespace std;
vector < vector<int> > rounds;
int main()
{
freopen("factor.in", "r", stdin);
freopen("factor.out", "w", stdout);
int n, m, x;
cin >> n;
vector <int> a;
for (int i = 0; i < n * 2; i++)
a.push_back(i + 1);
for (int i = 0; i < n * 2; i++)
{
rounds.push_back(a);
rotate(a.begin() + 1, a.end() - 1, a.end());
}
cin >> m;
int used = 0;
while (m--)
{
cin >> x;
for (int i = 0; i < x; i++)
for (int j = 0; j < n; j++)
cout << rounds[used + i][j] << ' ' << rounds[used + i][n * 2 - 1 - j] << endl;
if (m) cout << endl;
used += x;
}
}