Minimum value exceeding X whose count of divisors has different parity with count of divisors of X | C ++ program for the above approach ; Function to find the minimum value exceeding x whose count of divisors has different parity with count of divisors of X ; Check if x is perfect square ; Driver Code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int minvalue_y ( int x ) { int n = sqrt ( x ) ; if ( n * n == x ) return x + 1 ; return pow ( n + 1 , 2 ) ; } int main ( ) { int x = 5 ; cout << minvalue_y ( x ) << endl ; return 0 ; }