function to check is subgrid is Magic Square
int magic ( int a , int b , int c , int d , int e , int f , int g , int h , int i ) { set < int > s1 = { a , b , c , d , e , f , g , h , i } , s2 = { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 } ;