Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: kakcode
Problemset: จับคู่เลขมงคล
Language: cpp
Time: 0.003 second
Submitted On: 2025-12-12 17:15:00
/*
TASK: จับคู่เลขมงคล
LANG: C++
AUTHOR: ICE
*/
#include <bits/stdc++.h>
using ll = long long;
#define forr(i, a, n) for (int i = a; i < n; i++)
const ll inf = 10e9;
#define int ll
using namespace std;
using pii = pair<int,int>;
signed main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
vector<int> arr(n);
for(int i=0;i<n;i++)cin>>arr[i];
int tar;
cin>>tar;
bool found = 0;
for(int i=0;i<n;i++){
for(int j=i+1;j<n;j++){
if(arr[i]+arr[j]==tar){
cout << arr[i] << ' '<< arr[j] << '\n';
found = 1;
}
}
}
if(!found)cout<<"No";
return 0;
}