-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
55 lines (42 loc) · 1.22 KB
/
Copy pathmain.cpp
File metadata and controls
55 lines (42 loc) · 1.22 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
/* ------------------------*/
/* Author: Himanshu Mude */
/*------------------------*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define gcj "Case #"
#define pb push_back
#define all(_obj) _obj.begin(), _obj.end()
#define F first
#define S second
#define pll pair<ll, ll>
#define vll vector<ll>
ll INF = 1e18;
const int N = 1e5 + 11, mod = 1e9 + 7;
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
/*------------------- Code Starts Here --------------------*/
void solve(){
ll n;
cin>>n;
if(n==1) cout<<"2\n";
else if(n==2) cout<<"1\n";
else {
cout<<(n+2)/3<<"\n";
}
}
int main()
{
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin); //file input.txt is opened in reading mode i.e "r"
freopen("Output3.txt","w",stdout); //file output.txt is opened in writing mode i.e "w"
#endif
fastio;
long long int t;
cin>>t;
while(t--)
{
solve();
}
return 0;
}