Problem - SMSMS

Limits: 2s, 256 MB

Given a matrix of n rows and m columns you have to perform two types of queries on the matrix.


This is a companion discussion topic for the original entry at https://toph.co/p/problem---smsms