Matrix Solution|The first line contains one integer t (11000) - the number of test cases

 Matrix solutions

The first line contains one integer t (11000) - the number of test cases



Each test case of two lines. Each of those lines contains two integers - the elements of the corresponding row of the matrix in each matrix, all four elements are distinct integers from 1 to 100


Output


For each test case print YES if the matrix can become beautiful or so otherwise. You may print each letter in any case (YES, yes. Yes will all be recognized as positive answer to no and no will all be recognized as negative answer)




Solution:


lst=[ ]

sublist=[]

for i in range(0,2):

 for j in range(0,2):

  sublist.append(int(input("Enter element")))

 lst.append(sublist)

 sublist=[]

  

print(lst)


if lst[0][0]<lst[1][0] and lst[1][0]<lst[1][1]:

 if lst[0][0]<lst[1][0] and lst[0][1]<lst[1][1]:

  print("Beautiful.")

else:

 print("Not beautiful.")

No comments:

Powered by Blogger.