Function to find number of valid positions for two queens in the N * N chess board
static double possiblePositions ( double n ) { double term1 = Math . Pow ( n , 4 ) ; double term2 = Math . Pow ( n , 3 ) ; double term3 = Math . Pow ( n , 2 ) ; double term4 = n / 3 ; double ans = ( Math . Ceiling ( term1 / 2 ) ) - ( Math . Ceiling ( 5 * term2 ) / 3 ) + ( Math . Ceiling ( 3 * term3 ) / 2 ) - term4 ; return ( long ) ans ; }