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 b78974e commit bfd4417Copy full SHA for bfd4417
1472AB- Fair Division.cpp
@@ -0,0 +1,48 @@
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 main()
10
+{
11
+ int t;
12
+ cin>>t;
13
+ while(t--)
14
+ {
15
+ int n;
16
+ cin>>n;
17
+ int a;
18
+ int one=0;
19
+ int sum = 0;
20
+ for(int i=0;i<n;i++)
21
22
+ cin>>a;
23
+ if(a==1)
24
25
+ one++;
26
+ sum++;
27
+ }
28
+ else
29
+ sum += 2;
30
31
+ if(sum % 2 == 0)
32
33
+ int div = sum/2;
34
+ if(div % 2 == 0)
35
+ cout<<"YES"<<endl;
36
37
38
+ if(one)
39
40
41
+ cout<<"NO"<<endl;
42
43
44
45
46
47
+ return 0;
48
+}
0 commit comments