c++
#include <iostream>
using namespace std;
int main()
{
int a, b, c, d, e;
cin >> a >> b >> c >> d >> e;
if (a <= d and b <= e or a <= e and b <= d) {
cout << "YES";
}
else if (c <= d and b <= e or c <= e and b <= d) {
cout << "YES";
}
else if (c <= d and a <= e or c <= e and a <= d) {
cout << "YES";
}
else {
cout << "NO";
}
return 0;
}
python
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
if a <= d and b <= e or a <= e and b <= d:
print("YES")
elif c <= d and b <= e or c <= e and b <= d:
print("YES")
elif c <= d and a <= e or c <= e and a <= d:
print("YES")
else:
print("NO")
Объяснение:
const n=5;
var a:array [1..n,1..n] of integer;
i,j,k,max:integer;
begin
for i:= 1 to n do
begin
for j:=1 to n do
begin
a[i,j]:=random(21)-10;
write(a[i,j]:5)
end;
writeln;
end;
max:=0;
for i:= 1 to n do
begin
k:=0;
for j:=1 to n do if a[i,j]<0 then k:=k+1;
if k>max then max:=k
end;
if max=0 then writeln ('Нет строк с отрицательными элементами')
else
begin
for i:= 1 to n do
begin
k:=0;
for j:=1 to n do if a[i,j]<0 then k:=k+1;
if k=max then writeln ('Строка, в которой находится наибольшее количество отрицательных элементов ',i)
end
end
end.