ADAPOWER - Ada and Power

题意翻译

**题目描述** 给定一个 $n*n$ 的矩阵,有两种操作: 一是加入操作,将原矩阵的某一个子矩阵的每个元素加上一个值。 二是询问操作,给定一个新的 $n*n$ 的矩阵,判断新矩阵是否为原矩阵的平方(矩阵乘法),若是,输出yes,否则输出no。 **输入格式** 第一行两个整数 $n,q$ 表示矩阵大小和询问个数。 接下来n行,每行n个整数,表示一个初始矩阵。 接下来q个询问,每个询问开头有一个操作数 $op$,表示操作一或二。 若 $op==1$ ,后面跟着五个整数 a,b,x,y,v 表示将第a行第b列到第x行第y列间的所有元素值加上v。 若 $op==2$,后面有着n行输入,每行n个整数,表示新的矩阵。 **输出格式** 对于每个询问二,输出yes或no。

题目描述

Ada the Ladybug got a new homework today. She was attending algebra class and teacher was lecturing about various utilizations of matrix multiplication. He wanted to teach his students about the power of matrix, so he gave them following homework: Students were given a matrix followed be multiple queries. The query of first kind is adding a number to each element of a rectangular region of their matrix. In the query of second kind, a matrix is given and students are asked, whether it is the second power of actual matrix. Can you help Ada to solve her homework? Input The first line contains two integers **1 , the size of square matrix and **1 , the number of queries.**** Each of the next **N** lines contains **N** integers **0 , the element on **x $ ^{th} $ ,y $ ^{th} $** coordinate of matrix.** Then **Q** queries follows: The query of first kind is **1** followed five integers **0 , specifing the part, to which the number will be added, and number **0 , the value which will be added.**** The query of second kind is **2** followed by **N** lines containing **N** integers, which are supposed to be the second power of actual matrix.

输入输出格式

输入格式


输出格式


For each query of second kind, print either **yes**, if given matrix is second power of actual state of matrix or **no** in the other case.

输入输出样例

暂无测试点