A
#include<bits/stdc++.h>
using namespace std;
int main(){
int x,y,n;cin>>x>>y>>n;
if(x+y<=n)cout<<"YES"<<endl;
else cout<<"NO"<<endl;
}
B
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
ll n,m;cin>>n>>m;ll k;cin>>k;
ll a[n+10];
for(int i=1;i<=n;i++)cin>>a[i];
ll sum=0;
for(int i=1;i<=n;i++)sum+=a[i];
sum/=k;
cout<<min(sum,m+1)<<endl;
}
C
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
void sol(){
ll a;cin>>a;
if(a==1){
cout<<"2 3"<<endl;
}
else if(a==1e9){
cout<<"1000000 999655488"<<endl;
}
else{
cout<<"1 ";
if(a%2==0)cout<<a+1<<endl;
else cout<<a-1<<endl;
}
}
int main(){
int t;cin>>t;
while(t--)sol();
return 0;
}
D
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
void sol(){
int n;cin>>n;ll a[n+10];
for(int i=1;i<=n;i++)cin>>a[i];
sort(a+1,a+n+1);
ll dp[n+10][4];
memset(dp,0,sizeof(dp));
//2 2 4 6 10 10
for(int i=1;i<=n;i++){
dp[i][1]=a[i];
dp[i][2]=max(dp[i-1][1]+dp[i][1],dp[i-1][2]);
if(dp[i-1][2]>dp[i][1]){
dp[i][3]=dp[i-1][2]+dp[i][1];
//cout<<dp[i][3]<<endl;
}
dp[i][3]=max(dp[i-1][3],dp[i][3]);
}
//for(int i=1;i<=n;i++)cout<<dp[i][2]<<" ";
//cout<<endl;
//for(int i=1;i<=n;i++)cout<<dp[i][3]<<" ";
//cout<<endl;
if(dp[n][3]==0)cout<<"-1"<<endl;
else cout<<dp[n][3]<<endl;
}
int main(){
int t;cin>>t;
while(t--)sol();
return 0;
}