#include #include #define N 8 short codelen(short run,short level) { if(run==0){ if(level==0) return 0; else if(level==1) return 3; else if(level== 2) return 5; else if(level== 3) return 6; else if(level== 4) return 8; else if(level== 5) return 9; else if(level== 6) return 9; else if(level== 7) return 11; else if(level== 8) return 13; else if(level== 9) return 13; else if(level==10) return 13; else if(level==11) return 13; else if(level==12) return 14; else if(level==13) return 14; else if(level==14) return 14; else if(level==15) return 14; else return 20; }else if(run==1){ if(level==1) return 4; else if(level== 2) return 7; else if(level== 3) return 9; else if(level== 4) return 11; else if(level== 5) return 13; else if(level== 6) return 14; else if(level== 7) return 14; else return 20; }else if(run==2){ if(level==1) return 5; else if(level== 2) return 8; else if(level== 3) return 11; else if(level== 4) return 13; else if(level== 5) return 14; else return 20; }else if(run==3){ if(level==1) return 6; else if(level== 2) return 9; else if(level== 3) return 13; else if(level== 4) return 14; else return 20; }else if(run==4){ if(level==1) return 6; else if(level== 2) return 11; else if(level== 3) return 13; else return 20; }else if(run==5){ if(level==1) return 7; else if(level== 2) return 11; else if(level== 3) return 14; else return 20; }else if(level==1){ if(run==6) return 7; else if(run== 7) return 7; else if(run== 8) return 8; else if(run== 9) return 8; else if(run==10) return 9; else if(run==11) return 9; else if(run==12) return 9; else if(run==13) return 9; else if(run==14) return 11; else if(run==15) return 11; else if(run==16) return 11; else if(run==17) return 13; else if(run==18) return 13; else if(run==19) return 13; else if(run==20) return 13; else if(run==21) return 13; else if(run==22) return 13; else if(run==23) return 14; else if(run==24) return 14; else if(run==25) return 14; else if(run==26) return 14; else return 20; }else if(level==2){ if(run==6) return 13; else if(run== 7) return 13; else if(run== 8) return 13; else if(run== 9) return 14; else if(run==10) return 14; else return 20; } else return 20; } int tcoeff(int *Y,int len) { short i; short run,level; int count; count=1; for(i=0;i0? Y[i]:-Y[i]; i++; } return count+2; } /* main() { int y[N*N]; int i,j; int count; for(j=0;j