alphacademy-cpp/hf/hf3/3.cpp
2022-11-24 20:44:22 +01:00

46 lines
1 KiB
C++

#include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main() {
int a,b,c,x,y;
int n;
cin >> n;
vector<string> out;
for (int i = 0; i < n; i++) {
cin >> a >> b >> c >> x >> y; // a: kutyakaja, b: macskakaja, c: uni, x: kutya, y: macska
for (int j = 0; j < a; j++) { //kutya
if (x>0) {
x--;
}
}
//cout<< x<<endl;
for (int j = 0; j < b; j++) { //macska
if (y>0) {
y--;
}
}
//cout<< y<<endl;
for (int j = 0; j < c; j++) { //uni
if (x>0) {
x--;
} else if (y>0) {
y--;
}
}
//cout<< x<< ' '<< y <<endl;
if (x == 0 && y == 0) {
out.push_back("YES");
//cout<<"ran yes";
} else {
out.push_back("NO");
//cout<<"ran no";
}
}
for (int i = 0; i < n; i++) {
cout<<out[i]<<endl;
}
}