Function to check if a number is prime or not .
bool isPrime ( int n ) { int i = 2 ; while ( i * i <= n ) { if ( n % i == 0 ) return false ; i ++ ; } return true ; } int minimumSum ( int n ) { if ( isPrime ( n ) ) return 1 ;