MCPcopy Create free account
hub / github.com/Vishruth-S/CompetitiveCode / main

Function main

CodeChef_problems/PRICECON/Solution.cpp:16–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14#define ll long long
15
16int main()
17{
18 int testCases;
19 cin >> testCases;
20 while (testCases--)
21 {
22 ll n, k;
23 cin >> n >> k;
24 ll p, s = 0;
25 for (int i = 0; i < n; ++i)
26 {
27 cin >> p;
28 if (p > k)
29 {
30 s += p - k;
31 }
32 }
33 cout << s << '\n';
34 }
35
36 return 0;
37}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected