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

Function main

CodeChef_problems/CSUM/solution.cpp:19–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17}
18
19int main() {
20 int t, n;
21 long long int k, input; // define reusable variable
22 string answer = "";
23 cin >> t; // input test case
24 for (int i=1; i<=t; i++) {
25 cin >> n >> k;
26 vector<long long int> A;
27 for (int j=0; j<n; j++) {
28 cin >> input;
29 // limit unnecesary input
30 // constrain input > = 1 and ignore if input > k
31 if (0 < input && input < k) {
32 A.push_back(input);
33 }
34 }
35 // sort vector ASC for knowing lower and highest boundary
36 sort(A.begin(), A.end());
37 answer = isPaired(A, A.size(), k) ? "Yes" : "No";
38 cout << answer << endl;
39 }
40}

Callers

nothing calls this directly

Calls 1

isPairedFunction · 0.85

Tested by

no test coverage detected