Task: Given a 2D screen, location of a pixel in the screen ie(x, y) and a color K, Replace color of the given pixel and all adjacent ( excluding diagonally adjacent ) same colored pixels with the given color K. Example: Input: 1 2 2 1 1 1 1 0 1 8 Output: 8 8 8 8 Here is the Code: Program in C++: #include<iostream> #include<bits/stdc++.h> using namespace std; int main()  { 	 int t; 	 cin>>t; 	 while(t--) 	 { 	     int n,m; 	     cin>>n>>m; 	     int a[n][m]; 	     for(int i=0;i<n;i++) 	     { 	         for(int j=0;j<m;j++) 	         { 	             cin>>a[i][j]; 	         } 	     } 	     int x,y,k; 	     cin>>x>>y>>k; 	     queue<pair<int,int>> q; 	     q.push(make_pair(x,y)); 	     int t1 = a[x][y]; 	    ...
Understanding can make things are Nothing.