Find the number of ways to divide number into four parts such that a = c and b = d | C ++ implementation for above approach ; Function to find the number of ways to divide N into four parts such that a = c and b = d ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int possibleways ( int n ) { if ( n % 2 == 1 ) return 0 ; else if ( n % 4 == 0 ) return n / 4 - 1 ; else return n / 4 ; } int main ( ) { int n = 20 ; cout << possibleways ( n ) ; return 0 ; }