-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathround_Gq1.cpp
More file actions
42 lines (39 loc) · 846 Bytes
/
Copy pathround_Gq1.cpp
File metadata and controls
42 lines (39 loc) · 846 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include <bits/stdc++.h>
using namespace std;
int main()
{
int samples;
cin >> samples;
int out=1;
while (samples--)
{
int m,n,p;
long long int sum=0;
cin>>m>>n>>p;
int arr[m][n];
for (int i = 0; i < m; i++)
{
for (int j = 0; j < n; j++)
{
cin>>arr[i][j];
}
}
for (int i = 0; i < n; i++)
{
int maxim = -1;
for (int j = 0; j < m; j++)
{
maxim = max(maxim, arr[j][i]);
}
sum += maxim;
}
long long int sum_john=0;
for (int i = 0; i < n; i++)
{
sum_john+=arr[p-1][i];
}
cout<<"Case #"<<out<<": "<<(sum-sum_john)<<endl;
out++;
}
return 0;
}