aboutsummaryrefslogtreecommitdiff
path: root/codechef/copsAndTheifDevu/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'codechef/copsAndTheifDevu/main.cpp')
-rw-r--r--codechef/copsAndTheifDevu/main.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/codechef/copsAndTheifDevu/main.cpp b/codechef/copsAndTheifDevu/main.cpp
new file mode 100644
index 0000000..914c012
--- /dev/null
+++ b/codechef/copsAndTheifDevu/main.cpp
@@ -0,0 +1,24 @@
+#include<bits/stdc++.h>
+
+using namespace std;
+
+int main () {
+ ios_base::sync_with_stdio(false);
+ cin.tie(NULL);
+ int tt;
+ cin >> tt;
+ while(tt--){
+ int m, x, y;
+ cin >> m >> x >> y;
+ vector<int> v(m);
+ for(int &x : v) cin >> x;
+ set<int> st;
+ for(int i = 0; i < v.size(); i++) {
+ for(int j = max(v[i] - (x * y) - 1, 0); j < min(v[i] + (x * y), 100); j++) {
+ st.insert(j);
+ }
+ }
+ cout << 100 - st.size() << endl;
+
+ }
+}