MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / main

Function main

CPP/findSum.cpp:22–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20
21
22int main()
23{
24 int t;
25 cin>>t;
26
27 while(t--){
28 int N ,M, X;
29 cin >> N >> M >> X;
30 int A[N], B[M];
31
32 for(int i = 0;i<N;i++)
33 cin >> A[i];
34
35 for(int i = 0;i<M;i++)
36 cin >> B[i];
37
38 Solution ob;
39 vector<pair<int, int>> vp = ob.allPairs(A, B, N, M, X);
40 int sz = vp.size();
41
42
43
44 if(sz==0)
45 cout<<-1<<endl;
46 else{
47 for(int i =0; i<sz;i++){
48 if(i==0)
49 cout<<vp[i].first<<" "<<vp[i].second;
50 else
51 cout<<", "<<vp[i].first<<" "<<vp[i].second;
52 }
53 cout<<endl;
54 }
55 }
56
57return 0;
58}

Callers

nothing calls this directly

Calls 2

allPairsMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected