Skip to content

Commit 4fb19e7

Browse files
authored
June Challenge 2020 Division 2
1 parent 4c8305e commit 4fb19e7

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

PRICECON.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#include<bits/stdc++.h>
2+
using namespace std;
3+
4+
int main(){
5+
ios::sync_with_stdio(0);
6+
cin.tie(0);
7+
cout.tie(0);
8+
9+
int test_cases;
10+
cin >> test_cases;
11+
while(test_cases--){
12+
int n,k,ans=0;
13+
cin >> n >> k;
14+
for(int i = 0; i < n; i++){
15+
int t;
16+
cin >> t;
17+
if (k < t) ans += t- k;
18+
}
19+
cout << ans << endl;
20+
}
21+
22+
return 0;
23+
}

0 commit comments

Comments
 (0)