#include <math.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <assert.h> #include <limits.h> #include <stdbool.h> int solution(int A,int B,int z) { return ( ( ( ( 1 >= A/B && 1 <= B/A ) ) && ( (2*z-2) % (A+B) == 0 ) )? ((2*z-2)/(A+B)): -1); } int main(){ int n,k; scanf("%d",&n); for(int i=1;i<n;i++) { for(int j=1;j<n;j++) { k=solution(i,j,n); printf("%d ",k); } printf("\n"); // your code goes here } return 0; }