public void gen_table() {
	    for (int i = 0; i <= MAX_NUM_LENGTH; ++i) {
	        for (int j = 0; j <= MAX_NUM_SUM; ++j) {
	            for (int k = 0; k <= MAX_SQRT_SUM; ++k) {
	                dyn_table[i][j][k] = 0;
	            }
	        }
	    }
	    dyn_table[0][0][0] = 1;

	    for (int i = 0; i < MAX_NUM_LENGTH; ++i) {
	        for (int j = 0; j <= 9 * i; ++j) {
	            for (int k = 0; k <= 9 * 9 * i; ++k) {
	                for (int l = 0; l < 10; ++l) {
	                    dyn_table[i + 1][j + l][k + l*l] += dyn_table[i][j][k];
	                }
	            }
	        }
	    }
	}