#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
ll n, m, t, i, j = 1;
cin >> t;
while(t--)
{
cin >> n;
int a[n];
ll sum1 = 0, sum2 = 0, sum = 0;
for(i=0;i<n;i++)
{
cin >> a[i];
if(a[i] < 0)
sum1 += a[i];
else if(a[i] > 0)
sum2 += a[i];
}
if(sum1 < sum2)
sum = sum2;
else
sum = 0;
cout << "Case " << j++ << ": " << sum << "\n";
}
return 0;
}
#define ll long long int
using namespace std;
int main()
{
ll n, m, t, i, j = 1;
cin >> t;
while(t--)
{
cin >> n;
int a[n];
ll sum1 = 0, sum2 = 0, sum = 0;
for(i=0;i<n;i++)
{
cin >> a[i];
if(a[i] < 0)
sum1 += a[i];
else if(a[i] > 0)
sum2 += a[i];
}
if(sum1 < sum2)
sum = sum2;
else
sum = 0;
cout << "Case " << j++ << ": " << sum << "\n";
}
return 0;
}
Comments
Post a Comment