Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 725a5cb

Browse files
adds the question for one fixed point
1 parent 39a1132 commit 725a5cb

File tree

1 file changed

+118
-0
lines changed

1 file changed

+118
-0
lines changed
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
#include <bits/stdc++.h>
2+
using namespace std;
3+
4+
// Type definitions
5+
typedef long long ll;
6+
typedef pair<int, int> pii;
7+
typedef pair<ll, ll> pll;
8+
typedef vector<int> vi;
9+
typedef vector<ll> vl;
10+
typedef vector<pii> vpii;
11+
typedef vector<pll> vpll;
12+
typedef vector<vi> vvi;
13+
typedef vector<vl> vvl;
14+
15+
// Macros
16+
#define nline "\n"
17+
#define all(x) (x).begin(), (x).end()
18+
#define rall(x) (x).rbegin(), (x).rend()
19+
#define sz(x) (int)(x).size()
20+
#define pb push_back
21+
#define mp make_pair
22+
#define F first
23+
#define S second
24+
#define forn(i, n) for (int i = 0; i < int(n); i++)
25+
#define forr(i, a, b) for (int i = a; i <= b; i++)
26+
#define ford(i, a, b) for (int i = a; i >= b; i--)
27+
#define elasped_time 1.0 * clock() / CLOCKS_PER_SEC
28+
29+
// Constants
30+
const int MOD = 1e9 + 7;
31+
const ll INF = 1e18;
32+
const double EPS = 1e-9;
33+
const double PI = acos(-1);
34+
35+
ll mod_add(ll a, ll b, ll m = MOD) { return ((a % m) + (b % m)) % m; }
36+
ll mod_sub(ll a, ll b, ll m = MOD) { return ((a % m) - (b % m) + m) % m; }
37+
ll mod_mul(ll a, ll b, ll m = MOD) { return ((a % m) * (b % m)) % m; }
38+
39+
ll mod_pow(ll base, ll exp, ll m = MOD)
40+
{
41+
ll res = 1;
42+
base %= m;
43+
while (exp > 0)
44+
{
45+
if (exp & 1)
46+
res = mod_mul(res, base, m);
47+
base = mod_mul(base, base, m);
48+
exp >>= 1;
49+
}
50+
return res;
51+
}
52+
53+
ll mod_inv(ll a, ll m = MOD)
54+
{
55+
return mod_pow(a, m - 2, m); // Only works if m is prime
56+
}
57+
58+
ll mod_div(ll a, ll b, ll m = MOD)
59+
{
60+
return mod_mul(a, mod_inv(b, m), m);
61+
}
62+
63+
// Binary exponentiation (for non-modular calculations)
64+
ll binpow(ll base, ll exp)
65+
{
66+
ll res = 1;
67+
while (exp > 0)
68+
{
69+
if (exp & 1)
70+
res *= base;
71+
base *= base;
72+
exp >>= 1;
73+
}
74+
return res;
75+
}
76+
77+
/************/
78+
void solve()
79+
{
80+
int n;
81+
cin >> n;
82+
83+
if (n & 1)
84+
{
85+
ford(i, n, 1)
86+
cout
87+
<< i << " ";
88+
}
89+
else
90+
cout << -1;
91+
92+
cout << nline;
93+
}
94+
int main()
95+
{
96+
ios_base::sync_with_stdio(0);
97+
cin.tie(0);
98+
cout.tie(0);
99+
100+
#ifndef ONLINE_JUDGE
101+
freopen("./outputs/input.txt", "r", stdin);
102+
freopen("./outputs/output.txt", "w", stdout);
103+
#endif
104+
105+
int t;
106+
cin >> t;
107+
while (t--)
108+
solve();
109+
110+
return 0;
111+
}
112+
// Explanation
113+
/*
114+
% If the number of elements in the permuation is even, we would not be able
115+
% to create the permutation,
116+
% else , if the number of element are odd,
117+
% In that case , print any permutation, it will satisify the propery
118+
*/

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /