Pair of integers with difference K having an element as the K | Java program to implement the above problem ; Function to find the required pair ; No pair possible ; Driver Code
class GFG { static void computePair ( double K ) { if ( K == 1 ) { System . out . print ( " No " ) ; return ; } else { System . out . print ( K * K / ( K - 1 ) + " ▁ " ) ; System . out . print ( K / ( K - 1 ) + "NEW_LINE"); } } public static void main ( String [ ] args ) { double K = 6 ; computePair ( K ) ; } }