From 95ef276560a3460c324a618f486bfee47da532b7 Mon Sep 17 00:00:00 2001 From: ShazidMahsrafi Date: Sun, 23 Jul 2023 00:44:06 +0600 Subject: [PATCH] initial commit --- 34B Sale/34B.cpp | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 34B Sale/34B.cpp diff --git a/34B Sale/34B.cpp b/34B Sale/34B.cpp new file mode 100644 index 0000000..84073d8 --- /dev/null +++ b/34B Sale/34B.cpp @@ -0,0 +1,38 @@ +#include +using namespace std; +using ll = long long; + + +void solve() +{ + int n,m; + cin>>n>>m; + vectorv; + for(int i=0; i>x; + v.push_back(x); + } + sort(v.begin(),v.end()); + int sum=0; + for(int i=0; i=0) + break; + else + sum+=abs(v[i]); + } + cout<> TC; + //cin.ignore(); + while (TC--) solve(); +} \ No newline at end of file