We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 07e21eb commit 444c3c5Copy full SHA for 444c3c5
1451A - Subtract or Divide.cpp
@@ -0,0 +1,28 @@
1
+// ॐ नमः शिवाय
2
+#include<bits/stdc++.h>
3
+using namespace std;
4
+#define ll long long
5
+
6
+// Code Written By: Vikash Patel
7
+// Codeforces Profile: https://codeforces.com/profile/vikashpatel
8
9
+int solve(int n)
10
+{
11
+ if(n<=3)
12
+ return n-1;
13
+ else if(n & 1)
14
+ return 3;
15
+ return 2;
16
+}
17
+int main()
18
19
+ int t;
20
+ cin>>t;
21
+ while(t--)
22
+ {
23
+ int n;
24
+ cin>>n;
25
+ cout<<solve(n)<<endl;
26
+ }
27
+ return 0;
28
0 commit comments