SP8667 ITRIX_D - Board-Queries
Description
**RishiKumar** spends most of his time in solving Querying problems. When solving a 2D Querying problem he got exhausted and he needs the help of someone .yes he got!! .. **Karthi** is in search of his girl and asked Rishi whether he saw his girl on his way . Rishi replied he knew where she has gone but he will disclose the truth if Karthi solve this Bloody Querying problem. Help Karthi to solve this!!!!
Given two 2D arrays X and Y . Max size of X and Y is 500. (500 x 500)
**There are 3 Operations (Three Types of Queries)**
A) 0 x1 y1 x2 y2 ---Swaps the contents of the rectangle given by the points (x1,y1) and (x2,y2) of X and Y
B) **1** x1 y1 x2 y2 --- Print the sum of all elements in rectangle given by points (x1,y1) and (x2,y2) of the array X.
C) **2** x1 y1 x2 y2 -- - Print the sum of all elements in rectangle given by points (x1,y1) and (x2,y2) of the array Y.
(Points (x1,y1) and (x2,y2 ) inclusive)
(x1,y1) –Top Left point of the rectangle and(x2,y2) –Bottom right point of the rectangle
**Input Format:**
The first line of the input file contains N – Dimension of the array (It is clear that array is square array i.e. length=breadth) .The next N lines contains N integers per line separated by space which are the elements of array X .The next N lines contains N integers per line separated by space which are the elements of the array Y. The next line contains and integer Q –Total number of Queries ..Then each of the following Q lines contains the Queries (as per the above operations)
**Constraints**: N
Input Format
N/A
Output Format
N/A