We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 19436a2 commit 09539fcCopy full SHA for 09539fc
1716A - 2-3 Moves.cpp
@@ -0,0 +1,41 @@
1
+// ॐ नमः शिवाय
2
+#include<bits/stdc++.h>
3
+using namespace std;
4
+
5
+#define ll long long
6
+#define pb push_back
7
+#define ff first
8
+#define ss second
9
+#define mp make_pair
10
11
+// Code Written By: Vikash Patel
12
+// Codeforces Profile: https://codeforces.com/profile/vikashpatel
13
14
+int solve(int n)
15
+{
16
+ if(n == 1)
17
+ return 2;
18
+ return (n+2)/3;
19
+}
20
21
+int main()
22
23
+ ios_base::sync_with_stdio(0);
24
+ cin.tie(0);
25
+ cout.tie(0);
26
27
+ // #ifndef ONLINE_JUDGE
28
+ // freopen("input.txt", "r", stdin);
29
+ // freopen("/Users/vikash/Desktop/output.txt", "w", stdout);
30
+ // #endif
31
32
+ int t;
33
+ cin>>t;
34
+ while(t--)
35
+ {
36
+ int n;
37
+ cin>>n;
38
+ cout<<solve(n)<<endl;
39
+ }
40
+ return 0;
41
0 commit comments