Minimum value exceeding X whose count of divisors has different parity with count of divisors of X | Java 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
import java . util . * ; class GFG { static int minvalue_y ( int x ) { int n = ( int ) Math . sqrt ( x ) ; if ( n * n == x ) return x + 1 ; return ( int ) Math . pow ( n + 1 , 2 ) ; } public static void main ( String [ ] args ) { int x = 5 ; System . out . print ( minvalue_y ( x ) ) ; } }