-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathkickstartroundh-solution4.cpp
More file actions
62 lines (58 loc) · 1.2 KB
/
kickstartroundh-solution4.cpp
File metadata and controls
62 lines (58 loc) · 1.2 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#include <cmath>
#include <functional>
#include <fstream>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <list>
#include <time.h>
#include <math.h>
#include <random>
#include <deque>
#include <queue>
#include <cassert>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <bitset>
#include <sstream>
#include <chrono>
#include <cstring>
using namespace std;
typedef long long ll;
#ifdef iq
mt19937 rnd(228);
#else
mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
#endif
int main() {
#ifdef iq
freopen("a.in", "r", stdin);
#endif
ios::sync_with_stdio(0);
cin.tie(0);
int t;
cin >> t;
auto solve = [&] () {
int n, x;
cin >> n >> x;
vector <int> a(n);
for (int i = 0; i < n; i++) cin >> a[i];
vector <pair <int, int> > q;
for (int i = 0; i < n; i++) {
q.push_back({(a[i] + x - 1) / x, i});
}
sort(q.begin(), q.end());
vector <int> ord(n);
for (int i = 0; i < n; i++) ord[i] = q[i].second;
for (int t : ord) cout << t + 1 << ' ';
};
for (int tc = 1; tc <= t; tc++) {
cout << "Case #" << tc << ": ";
solve();
cout << '\n';
}
}