Могу с c++ #include <iostream> using namespace std; int main () { int a, b, c, x, y; cin >> a >> b >> c >> x >> y; if ( (( x >= a) && (y >= b )) || (( x >= b) && (y >= a )) || (( x >= a ) && (y >= c )) || (( x >= c ) && (y >= a )) || (( x >= c ) && (y >= b )) || (( x >= b) && (y >= c ))) { cout << "YES"; } else { cout << "NO"; } return 0; } a=X b=Y c=Z x=длина кирпича y=ширина
#include <cmath>
using namespace std;
double dist(double x[2], double y[2]) {
return sqrt((x[0] - y[0]) * (x[0] - y[0]) + (x[1] - y[1]) * (x[1] - y[1]));
}
int main() {
double points[4][2];
for (int i = 0; i != 4; ++i) {
cin >> points[i][0] >> points[i][1];
}
double min = dist(points[0], points[1]);
for (int i = 0; i != 4; ++i) {
for (int j = i + 1; j != 4; ++j) {
double new_min = dist(points[i], points[j]);
if (new_min < min) {
min = new_min;
}
}
}
cout << min;
}