-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathA_Average_Height.cpp
More file actions
63 lines (62 loc) · 1.04 KB
/
Copy pathA_Average_Height.cpp
File metadata and controls
63 lines (62 loc) · 1.04 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
#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<queue>
using namespace std;
typedef long long int ll;
const int N = 2e3 + 100;
const int mod = 1e9 + 7;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll t;cin>>t;
while(t--)
{
ll n;cin>>n;
// vector<ll> a,b;
// ll x;
// for(ll i=0;i<n;i++)
// {
// cin>>x;
// if(x%2==1){
// b.push_back(x);
// }
// else {
// a.push_back(x);
// }
// }
// for(auto i:b)
// {
// cout<< i << " ";
// }
// for(auto i:a)
// {
// cout<< i << " ";
// }
// cout<< '\n';
ll a[n];
for(ll i=0;i<n;i++)
{
cin>>a[i];
}
for(ll i=0;i<n;i++)
{
//cin>>a[i];
if(a[i]%2==1)
{
cout<< a[i] << " ";
}
}
for(ll i=0;i<n;i++)
{
//cin>>a[i];
if(a[i]%2==0)
{
cout<< a[i] << " ";
}
}
cout<< '\n';
}
return 0;
} //Code Contributed by Harshit Varshney