aboutsummaryrefslogtreecommitdiff
path: root/codechef/ArmyTraining/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'codechef/ArmyTraining/main.cpp')
-rw-r--r--codechef/ArmyTraining/main.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/codechef/ArmyTraining/main.cpp b/codechef/ArmyTraining/main.cpp
new file mode 100644
index 0000000..a85f4f3
--- /dev/null
+++ b/codechef/ArmyTraining/main.cpp
@@ -0,0 +1,25 @@
+#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 n;
+ cin >> n;
+ long long att = 0;
+ long long def = 0;
+ for(int i = 0; i < n; i++) {
+ int x;
+ cin >> x;
+ if(x <= 500) {
+ def += 1000 - x;
+ } else {
+ att += x;
+ }
+ }
+ }
+}