Code
#include <iostream>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
int n;
cin >> n;
if (n<=4)
{
cout<<-1<<'\n';
} else
{
int val = 1;
for (int i = 0;i<n;i++)
{
cout << val << " ";
if (val+3 == n)
val=n;
else
val = (val+3)%n;
}
}
}
}
Information
- Submit By
- Type
- Pretest
- Problem
- P1203 D. Roy Loves Permutation
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2025-06-13 17:04:20
- Judged At
- 2025-06-13 17:04:20
- Judged By
- Score
- 0
- Total Time
- 1ms
- Peak Memory
- 532.0 KiB