-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2220A.cpp
More file actions
79 lines (62 loc) · 1.47 KB
/
Copy path2220A.cpp
File metadata and controls
79 lines (62 loc) · 1.47 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*
Code by: KoKoDuDu
Created: 2026.04.13 21:41:17
*/
#include <bits/stdc++.h>
#define int long long
#define ldb long double
#define pii pair<int, int>
#define cd complex<double>
#define fi first
#define se second
using namespace std;
const double PI = acos(-1);
const int kMaxN = 2e5 + 0307;
const int kMod = 1e9 + 7;
const int kMaxBit = 60;
const int kMaxInf = 1e18;
const int kMinInf = -1e18;
int ceil_div(int a, int b) { return a >= 0 ? (a + b - 1) / b : a / b; }
int floor_div(int a, int b) { return a <= 0 ? (a - b + 1) / b : a / b; }
void add_mod(int& a, int b) { a = a + b >= kMod ? a + b - kMod : a + b; }
void minus_mod(int& a, int b) { a = (a - b + kMod) % kMod; }
void mul_mod(int& a, int b) { a = a * b % kMod; }
void maximize(int& x, int y) { x = max(x, y); }
void minimize(int& x, int y) { x = min(x, y); }
int fpow(int a, int b) {
int res = 1;
while (b) {
if (b & 1) res = res * a % kMod;
a = a * a % kMod;
b >>= 1;
}
return res;
}
int gcd(int a, int b) {
if (a < b) swap(a, b);
return b == 0 ? a : gcd(b, a % b);
}
void solve() {
int n;
cin >> n;
vector<int> a(n);
for (int& c : a) cin >> c;
sort(a.begin(), a.end(), greater<>());
for (int i = 1; i < n; ++i) {
if (a[i] == a[i - 1]) {
cout << -1 << '\n';
return;
}
}
for (int& c : a) cout << c << ' ';
cout << '\n';
}
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int t = 1;
cin >> t;
while (t--) solve();
return 0;
}