-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemp3.cpp
59 lines (52 loc) · 1.05 KB
/
temp3.cpp
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
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ar array
#define vi vector<int>
#define vvi vector<vector<int>>
#define forn(i,n) for(ll i=0; i<(n); i++)
#define fori(i,k,n) for(ll i=k; i<(n); i++)
#define all(x) (x).begin(),(x).end()
#define en '\n'
template<typename T> void print(vector<T>& a)
{
for (int i = 0; i < a.size(); i++)
cout << a[i] << ' ';
cout << en;
}
template<typename T> void print(deque<T>& a)
{
for (int i = 0; i < a.size(); i++)
cout << a[i] << ' ';
cout << en;
}
template<typename T> void print(vector<vector<T>>& a)
{
for (int i = 0; i < a.size(); i++)
{
for (int j = 0; j < a[i].size(); j++)
cout << a[i][j] << ' ';
cout << en;
}
}
void solve(){
int n; cin >> n;
vector<int> ans(n-1);
for(int i=2; i<=n; i++){
ans[i-2] = biggestFactor(i);
}
sort(all(ans));
print(ans);
}
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
#ifdef _DEBUG
freopen("input.txt", "r", stdin);
#endif
int t; cin >> t;
while(t--)
solve();
return 0;
}