-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpoker.cpp
More file actions
35 lines (31 loc) · 747 Bytes
/
poker.cpp
File metadata and controls
35 lines (31 loc) · 747 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
34
35
#include <iostream>
#include <vector>
#include <memory.h>
using namespace std;
int num[10000000];
int main()
{
int pir;
int n, k;
cin >> pir;
while (pir--) {
memset(num, 0, sizeof(num));
cin >> n >> k;
for (int i = 0; i< 2*n; i++) {
int temp = i + 1;
for (int j = 0; j < k; j++)
if (temp > n)
temp = 2 * (temp - n);
else
temp = 2 * temp - 1;
cin >> num[temp-1];
}
for (int i = 0; i < 2*n; i++) {
if (pir == 0 && i == 2*n - 1)
cout << num[i];
else
cout << num[i] << " ";
}
}
return 0;
}