From 95422138588572e08a1ee78e654741874f11cfa0 Mon Sep 17 00:00:00 2001 From: omagdy7 Date: Thu, 10 Nov 2022 16:05:26 +0200 Subject: Added some new problems --- codeforces/TwoGroups/main | Bin 0 -> 22576 bytes codeforces/TwoGroups/main.cpp | 21 +++++++++++++++++++++ codeforces/TwoGroups/main_input0.txt | 9 +++++++++ codeforces/TwoGroups/main_output0.txt | 4 ++++ 4 files changed, 34 insertions(+) create mode 100755 codeforces/TwoGroups/main create mode 100644 codeforces/TwoGroups/main.cpp create mode 100644 codeforces/TwoGroups/main_input0.txt create mode 100644 codeforces/TwoGroups/main_output0.txt (limited to 'codeforces/TwoGroups') diff --git a/codeforces/TwoGroups/main b/codeforces/TwoGroups/main new file mode 100755 index 0000000..9c03086 Binary files /dev/null and b/codeforces/TwoGroups/main differ diff --git a/codeforces/TwoGroups/main.cpp b/codeforces/TwoGroups/main.cpp new file mode 100644 index 0000000..0f7a8f9 --- /dev/null +++ b/codeforces/TwoGroups/main.cpp @@ -0,0 +1,21 @@ +#include + +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 ans = 0; + for (int i = 0; i < n; i++) { + int x; + cin >> x; + ans += x; + } + cout << abs(ans) << '\n'; + } +} diff --git a/codeforces/TwoGroups/main_input0.txt b/codeforces/TwoGroups/main_input0.txt new file mode 100644 index 0000000..fadd76c --- /dev/null +++ b/codeforces/TwoGroups/main_input0.txt @@ -0,0 +1,9 @@ +4 +2 +10 -10 +4 +-2 -1 11 0 +3 +2 3 2 +5 +-9 2 0 0 -4 diff --git a/codeforces/TwoGroups/main_output0.txt b/codeforces/TwoGroups/main_output0.txt new file mode 100644 index 0000000..5a36ed8 --- /dev/null +++ b/codeforces/TwoGroups/main_output0.txt @@ -0,0 +1,4 @@ +0 +8 +7 +11 -- cgit v1.2.3