Answer to Question #307370 in Python for Shalini S

Question #307370

iven an integer N  denotes N×N  matrix. Initially, each cell of matrix is empty. U r given K  tasks. In each task, you are given a cell (i,j)  where cell (i,j)  represents

ith  row and jth  column of given matrix.

I/p format

  • first line contains two space-separated integers N and K where N is number of rows and columns in given matrix and K is number of tasks respectively.
  • Next K lines contain two space-separated integers i and j.

O/p format

Print K space-separated integers denoting numberr of empty cells in matrix.


1
Expert's answer
2022-03-07T12:52:57-0500
input1 = int(input('Enter space separated numbers: '))
N = input1.split()[0]
K = input1.split()[1]
j = 0
for i in range(N):
    for k in range(K):
        j = j + 1
        print(j, end = ' ')
    print()

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS