Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: matcherbrainner

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

Language: cpp

Time: 0.002 second

Submitted On: 2026-10-04 16:03:04

#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,w;
	cin>>n;
	int k[n];
	for(int i=0;i<n;i++){
		cin>>k[i];
	}
	cin>>w;
	bool po=true;
	for(int p=0;p<n;p++){
		for(int l=p+1;l<n;l++){
			if(k[p]+k[l]==w){
				cout<<k[p]<<" "<<k[l]<<"\n";
				po=false;
			}
		}
	}
	if(po){
		cout<<"No";
	}
}