Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: chillxvtkz

Problemset: จับคู่เลขมงคล

Language: cpp

Time: 0.004 second

Submitted On: 2026-10-07 09:15:26

#include <bits/stdc++.h>
#define ll long long
#define ct cout << ' '
#define el cout << endl;
using namespace std;
const int mx = 1e9;
const int mn = 1e-9;

int n,t,b,c=0;
vector<int> v;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        cin >> t;
        v.push_back(t);
    }
    cin >> b;

    for (int i = 0; i < n-1; i++)
    {
        for (int j = i+1; j < n; j++)
        {
            if((v[i]+v[j])==b){
                c=1;
                cout << v[i] << " " << v[j];el;break;
            }
        }
        
    }
    if(c==0) cout << "No";
    
    return 0;
}