#include <functional>
#include <iostream>

using namespace std;

/**
 * Checks if node is adj to all nodes in subgraph.
 *
 * @param node      the node to check for adjacency all other nodes in the subgraph
 * @param subgraph  an array of node integers
 * @param len       the length of the subgraph array
 * @param adj       a function accepting two integers corresponding to nodes and returns 
 *                  whether they are adjacent
 * @returns         whether node is adjacent to all nodes in subgraph.
 */ 
inline bool adj_all(int node, int* subgraph, int len, const function<bool(int, int)> &adj){
	for(int i = 0;i < len;i++){
		//cout << "Comparing with " << nodes[chain[i]] << "." << endl;
		if(i == node || !adj(subgraph[i], node)) {
			return false;
		}
	}
	return true;
}

/**
 * Finds the size of the maximal clique in the graph.
 *
 * @param num_nodes     the number of nodes
 * @param adj           a function accepting two integers corresponding to nodes and returns 
 *                      whether they are adjacent
 * @returns the size of the maximal clique.
 */
int max_clique(int num_nodes, const function<bool(int, int)> &adj)
{
	if(num_nodes <= 0)
		return 0;
	
	// Holds indices into nodes of current clique. Permuted to check every subgraph.
	// The stack is kept in sorted order (solely by nature of how it is incremented/permuted) so
	// as to only check each subgraph once.
	int stack[num_nodes + 1];
	stack[0] = 0;
	
	// Holds the current index in the stack to permute.
	int index = 0;
	
	// Holds the size of the largest clique found.
	int max_len = 0;
	
	while(index >= 0) {
		bool complete = true;
		
		// Down the tree. Add new nodes to the stack while we can find a neighbor to the 
		// top node on the stack that is also adjacent to all nodes in the stack.
		while(complete) {
			
			// Find a neighbor.
			complete = false; // This will stay false if no neighbor is found.
			for(int i = stack[index] + 1;!complete && i < num_nodes;i++) {
				if(adj_all(i, stack, index + 1, adj)) {
					stack[index + 1] = i; // Add this node to the stack.
					index++; // Advance the stack pointer.
					complete = true;
				}
			}

		}
		complete = false;
		
		if(index + 1 > max_len) {
			max_len = index + 1;
		}
		
		while(!complete && index >= 0) {
			do {
				// If we get here, no suitable neighbor could be found for the top node on the 
				// stack.
				// So we will permute the last neighbor on the stack.
				stack[index]++;
				complete = adj_all(stack[index], stack, index, adj);
			} while(!complete && stack[index] < num_nodes);
			
			if(stack[index] >= num_nodes) {
				// If we get here, we've tried all possibilities for top node on the stack and 
				// none of them were complete with the rest of the stack, so we need to pop the 
				// node off the stack and start permuting the node below it.
				index--; // Pop the stack.
				
				stack[index]++;
				complete = adj_all(stack[index], stack, index, adj);
			}
		}
	}
	
	return max_len;
}

/**
 * Whether two nodes are adjacent.
 */
bool adj1(int n1, int n2) {
  static int connects[9][9] = {
  {0,1,1,1,0,0,1,1,1},
  {1,0,1,1,0,0,0,1,1},
  {1,1,0,1,1,1,0,0,1},
  {1,1,1,0,1,1,1,0,0},
  {0,0,1,1,0,1,1,0,0},
  {0,0,1,1,1,0,1,1,1},
  {1,0,0,1,1,1,0,1,1},
  {1,1,0,0,0,1,1,0,1},
  {1,1,1,0,0,1,1,1,0}};
  
  return connects[n1][n2];
}

/**
 * Whether two nodes are adjacent.
 */
bool adj2(int n1, int n2) {
  static int connects[23][23] = {
  {0,0,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0},
  {0,0,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,0,1,1,1},
  {1,1,0,0,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,0,1,0},
  {0,1,0,0,1,1,0,1,1,1,0,0,0,1,1,1,1,1,1,1,1,0,1},
  {1,1,1,1,0,1,1,0,1,1,1,0,0,0,1,1,1,1,1,1,1,1,0},
  {0,1,1,1,1,0,1,1,0,1,1,1,0,1,1,1,0,0,1,1,1,1,1},
  {1,0,1,0,1,1,0,1,1,0,1,1,1,0,1,1,1,0,1,1,1,1,1},
  {1,0,0,1,0,1,1,0,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1},
  {1,0,0,1,1,0,1,1,0,1,1,0,1,1,1,0,1,1,1,1,1,1,1},
  {1,1,0,1,1,1,0,1,1,0,1,1,0,1,1,1,0,1,0,1,1,1,1},
  {1,1,1,0,1,1,1,0,1,1,0,1,1,0,1,1,1,0,0,0,1,1,1},
  {1,1,1,0,0,1,1,1,0,1,1,0,1,1,0,1,1,1,0,0,1,1,1},
  {1,1,1,0,0,0,1,1,1,0,1,1,0,1,1,0,1,1,1,0,1,1,1},
  {1,1,1,1,0,1,0,1,1,1,0,1,1,0,1,1,0,1,1,1,0,1,1},
  {1,1,1,1,1,1,1,0,1,1,1,0,1,1,0,1,1,0,1,1,0,0,1},
  {1,1,1,1,1,1,1,1,0,1,1,1,0,1,1,0,1,1,0,1,0,0,1},
  {1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,0,1,1,0,1,0,1},
  {1,1,1,1,1,0,0,1,1,1,0,1,1,1,0,1,1,0,1,1,1,1,0},
  {0,1,1,1,1,1,1,1,1,0,0,0,1,1,1,0,1,1,0,1,1,1,1},
  {1,0,1,1,1,1,1,1,1,1,0,0,0,1,1,1,0,1,1,0,0,1,0},
  {0,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,0,0,1,1},
  {1,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,0,0},
  {0,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,0}};
  
  return connects[n1][n2];
}

/**
 * Whether two nodes are adjacent.
 */
bool adj3(int n1, int n2) {
  static int connects[41][41] = {
  {0,1,1,1,1,1,1,1,1,0,1,1,1,0,1,0,0,1,1,1,1,1,1,1,1,0,0,1,0,1,1,1,0,1,1,1,1,1,1,1,1},
  {1,0,1,1,1,1,1,1,1,1,0,1,1,0,0,1,0,0,1,1,1,1,1,1,1,0,1,0,0,0,1,1,1,0,1,1,1,1,1,1,1},
  {1,1,0,1,1,1,1,1,1,0,1,0,1,1,0,1,0,0,0,1,1,1,1,1,1,0,1,1,1,0,0,1,0,1,0,1,1,1,1,1,1},
  {1,1,1,0,1,1,1,1,1,1,0,1,0,1,1,1,1,0,0,0,1,1,1,1,1,1,0,1,1,1,0,0,1,0,1,0,1,1,1,1,1},
  {1,1,1,1,0,1,1,1,1,0,1,0,1,1,1,0,1,1,0,0,0,1,1,1,1,1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,1,0,1,1,0,0,1,1,1,1,0}};

  
  return connects[n1][n2];
}

int main() {
  cout << max_clique(9, adj1) << endl;
  cout << max_clique(23, adj2) << endl;
  cout << max_clique(41, adj3) << endl;
  cout << max_clique(51, adj4) << endl;
  cout << max_clique(53, adj5) << endl;
  return 0;
}