, determine weither it is possible to make all entrys of. a×b submatrices and reduce the values in the chosen matrices by 1. If possible, print "^_^" in one line, or print "QAQ" in one line.
Given a matrix M_{} M of size ntimes m n×m and two integers a, b_{} a,b , determine weither it is possible to make all entrys of M_{} M zero by repeatedly choosing atimes b a×b submatrices and reduce the values in the chosen matrices by 1. If possible, print "^_^" in one line, or print "QAQ" in one line.
(图片来源网络,侵删)