Driver code
public static void Main ( String [ ] args ) { int [ , ] edges = { { 1 , 2 } , { 2 , 3 } , { 3 , 1 } , { 4 , 3 } , { 4 , 5 } , { 5 , 3 } } ; int size = edges . GetLength ( 0 ) ; n = 5 ; bool [ ] prime = new bool [ n + 1 ] ; for ( int i = 0 ; i < prime . Length ; i ++ ) prime [ i ] = true ; SieveOfEratosthenes ( prime , n ) ; for ( int i = 0 ; i < size ; i ++ ) { graph [ edges [ i , 0 ] , edges [ i , 1 ] ] = 1 ; graph [ edges [ i , 1 ] , edges [ i , 0 ] ] = 1 ; d [ edges [ i , 0 ] ] ++ ; d [ edges [ i , 1 ] ] ++ ; } ans = 0 ; primeCliques ( 0 , 1 , prime ) ; Console . WriteLine ( ans ) ; } }