#include #include #include #include #include using namespace std; int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ vector< vector > a(3,vector(3)); vector arr(10); int sum=100,diff=0; for(int a_i = 0;a_i < 3;a_i++){ for(int a_j = 0;a_j < 3;a_j++){ cin >> a[a_i][a_j]; } } int a1[3][3] = { {8, 1, 6} , {3, 5, 7} , {4, 9, 2} }; int a2[3][3] = { {8, 3, 4} , {1, 5, 9} , {6, 7, 2} }; int a3[3][3] = { {4, 3, 8} , {9, 5, 1} , {2, 7, 6} }; int a4[3][3] = { {4, 9, 2} , {3, 5, 7} , {8, 1, 6} }; int a5[3][3] = { {2, 9, 4} , {7, 5, 3} , {6, 1, 8} }; int a6[3][3] = { {2, 7, 6} , {9, 5, 1} , {4, 3, 8} }; int a7[3][3] = { {6, 7, 2} , {1, 5, 9} , {8, 3, 4} }; int a8[3][3] = { {6, 1, 8} , {7, 5, 3} , {2, 9, 4} }; for(int i=0; i<3; i++) { for(int j=0; j<3; j++) { diff= diff +abs(a[i][j]-a1[i][j]); } } if(diff