codeparrot/xlcost-text-to-code huggingface dataset:
Count of the non | Java program to find count of non - prime divisors of given number ; Function to factors of the given number ; Loop to find the divisors of the number 2 ; Loop to find the divisors of the given number upto SQRT ( N ) ; Condition to check if the rest number is also a prime number ; Function to find the non - prime divisors of the given number ; Loop to count the number of the total divisors of given number ; Driver Code ; Function Call
import java . util . * ; class GFG { static Vector < Integer > getFactorization ( int x ) { int count = 0 ; Vector < Integer > v = new Vector < > ( ) ; while ( x % 2 == 0 ) { count ++ ; x = x / 2 ; } if ( count != 0 ) v . add ( count ) ; for ( int i = 3 ; i <= Math . sqrt ( x ) ; i += 2 ) { count = 0 ; while ( x % i == 0 ) { count ++ ; x /= i ; } if ( count != 0 ) v . add ( count ) ; } if ( x > 1 ) { v . add ( 1 ) ; } return v ; } static int nonPrimeDivisors ( int N ) { Vector < Integer > v = getFactorization ( N ) ; int ret = 1 ; for ( int i = 0 ; i < v . size ( ) ; i ++ ) ret = ret * ( v . get ( i ) + 1 ) ; ret = ret - v . size ( ) ; return ret ; } public static void main ( String [ ] args ) { int N = 8 ; System . out . println ( nonPrimeDivisors ( N ) ) ; } }
Check if a number is Full Fibonacci or not | Java program to check if a given number is a full fibonacci number or not ; A utility function that returns true if x is perfect square ; Returns true if N is a fibonacci number and false otherwise ; N is fibonacci if one of 5 * N ^ 2 + 4 or 5 * N ^ 2 - 4 or both is a perferct square ; Function to check digits ; Check if all digits are fibonacci or not ; Extract digit ; Check if the current digit is not fibonacci ; Function to check and return if N is a full fibonacci number or not ; Driver code
import java . util . * ; class GFG { static boolean isPerfectSquare ( int x ) { int s = ( int ) Math . sqrt ( x ) ; return ( s * s == x ) ; } static boolean isFibonacci ( int n ) { return isPerfectSquare ( 5 * n * n + 4 ) || isPerfectSquare ( 5 * n * n - 4 ) ; } static boolean checkDigits ( int n ) { while ( n != 0 ) { int dig = n % 10 ; if ( dig == 4 && dig == 6 && dig == 7 && dig == 9 ) return false ; n /= 10 ; } return true ; } static boolean isFullfibonacci ( int n ) { return ( checkDigits ( n ) && isFibonacci ( n ) ) ; } public static void main ( String [ ] args ) { int n = 13 ; if ( isFullfibonacci ( n ) ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } }
Check whether a large number is divisible by 53 or not | Java program to check whether a number is divisible by 53 or not ; Function to check if the number is divisible by 53 or not ; Driver Code
import java . util . * ; class GFG { static boolean isDivisible ( char [ ] s ) { while ( s . length > 4 ) { int l = s . length - 1 ; int x = ( s [ l ] - '0' ) * 37 ; s = reverse ( s ) ; s = Arrays . copyOfRange ( s , 1 , s . length ) ; int i = 0 , carry = 0 ; while ( x > 0 ) { int d = ( s [ i ] - '0' ) - ( x % 10 ) - carry ; if ( d < 0 ) { d += 10 ; carry = 1 ; } else carry = 0 ; s [ i ] = ( char ) ( d + '0' ) ; x /= 10 ; i ++ ; } while ( carry > 0 && i < l ) { int d = ( s [ i ] - '0' ) - carry ; if ( d < 0 ) { d += 10 ; carry = 1 ; } else carry = 0 ; s [ i ] = ( char ) ( d + '0' ) ; i ++ ; } s = reverse ( s ) ; } int num = 0 ; for ( int i = 0 ; i < s . length ; i ++ ) { num = num * 10 + ( s [ i ] - '0' ) ; } if ( num % 53 == 0 ) return true ; else return false ; } static char [ ] reverse ( char [ ] a ) { int l , r = a . length - 1 ; for ( l = 0 ; l < r ; l ++ , r -- ) { char temp = a [ l ] ; a [ l ] = a [ r ] ; a [ r ] = temp ; } return a ; } public static void main ( String [ ] args ) { String N = "18432462191076" ; if ( isDivisible ( N . toCharArray ( ) ) ) System . out . print ( " Yes " + "NEW_LINE"); else System . out . print ( " No " + "NEW_LINE"); } }
Check whether two numbers are in silver ratio | Java implementation to check whether two numbers are in silver ratio with each other ; Function to check that two numbers are in silver ratio ; Swapping the numbers such that A contains the maximum number between these numbers ; First Ratio ; Second Ratio ; Condition to check that two numbers are in silver ratio ; Driver Code ; Function call
import java . util . * ; import java . lang . * ; class GFG { static boolean checksilverRatio ( double a , double b ) { if ( a < b ) { a = a + b ; b = a - b ; a = a - b ; } double ratio1 = ( ( a / b ) * 1000 ) / 1000 ; double ratio2 = ( int ) ( ( ( 2 * a + b ) / a ) * 1000 ) ; ratio2 = ratio2 / 1000 ; if ( ratio1 == ratio2 && ( int ) ( ratio1 - 2.414 ) == 0 ) { System . out . println ( " Yes " ) ; return true ; } else { System . out . println ( " No " ) ; return false ; } } public static void main ( String [ ] args ) { double a = 2.414 ; double b = 1 ; checksilverRatio ( a , b ) ; } }
Nth term where K + 1 th term is product of Kth term with difference of max and min digit of Kth term | Java implementation to find the value of the given function for the value ; Function to find minimum digit in the decimal representation of N ; Loop to find the minimum digit in the number ; Function to find maximum digit in the decimal representation of N ; Loop to find the maximum digit in the number ; Function to find the value of the given function ; Loop to compute the values of the given number ; Driver Code ; Function Call
class GFG { static int MIN ( int n ) { int ans = 11 ; while ( n > 0 ) { ans = Math . min ( ans , n % 10 ) ; n /= 10 ; } return ans ; } static int MAX ( int n ) { int ans = - 1 ; while ( n > 0 ) { ans = Math . max ( ans , n % 10 ) ; n /= 10 ; } return ans ; } static void Find_value ( int n , int k ) { k -- ; int x = 0 ; int y = 0 ; while ( k -- > 0 ) { x = MIN ( n ) ; y = MAX ( n ) ; if ( y - x == 0 ) break ; n *= ( y - x ) ; } System . out . print ( n ) ; } public static void main ( String [ ] args ) { int N = 487 , D = 5 ; Find_value ( N , D ) ; } }
Program to check if N is a Decagonal Number | Java program for the above approach ; Function to check if N is a decagonal number ; Condition to check if the number is a decagonal number ; Driver code ; Given number ; Function call
import java . lang . Math ; class GFG { public static boolean isdecagonal ( int N ) { double n = ( 3 + Math . sqrt ( 16 * N + 9 ) ) / 8 ; return ( n - ( int ) n ) == 0 ; } public static void main ( String [ ] args ) { int N = 10 ; if ( isdecagonal ( N ) ) { System . out . println ( " Yes " ) ; } else { System . out . println ( " No " ) ; } } }
Program to check if N is a Octadecagon number | Java program for the above approach ; Function to check if N is a octadecagon Number ; Condition to check if the number is a octadecagon number ; Driver Code ; Given Number ; Function call
import java . lang . Math ; class GFG { public static boolean isOctadecagon ( int N ) { double n = ( 14 + Math . sqrt ( 128 * N + 196 ) ) / 32 ; return ( n - ( int ) n ) == 0 ; } public static void main ( String [ ] args ) { int N = 18 ; if ( isOctadecagon ( N ) ) { System . out . println ( " Yes " ) ; } else { System . out . println ( " No " ) ; } } }
Count of subsequences which consists exactly K prime numbers | Java implementation to find the count of subsequences which consist exactly K primes ; Returns factorial of n ; Function to return total number of combinations ; Function check whether a number is prime or not ; Corner case ; Check from 2 to n - 1 ; Function for finding number of subsequences which consists exactly K primes ; If number of primes are less thn k ; Driver code
import java . util . * ; class GFG { static int fact ( int n ) { int res = 1 ; for ( int i = 2 ; i <= n ; i ++ ) res = res * i ; return res ; } static int nCr ( int n , int r ) { return fact ( n ) / ( fact ( r ) * fact ( n - r ) ) ; } static boolean isPrime ( int n ) { if ( n <= 1 ) return false ; for ( int i = 2 ; i < n ; i ++ ) if ( n % i == 0 ) return false ; return true ; } static int countSubsequences ( int arr [ ] , int n , int k ) { int countPrime = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( isPrime ( arr [ i ] ) ) countPrime ++ ; } if ( countPrime < k ) return 0 ; return nCr ( countPrime , k ) * ( int ) Math . pow ( 2 , ( n - countPrime ) ) ; } public static void main ( String args [ ] ) { int arr [ ] = { 1 , 2 , 3 , 4 , 5 , 6 , 7 } ; int K = 3 ; int n = arr . length ; System . out . println ( countSubsequences ( arr , n , K ) ) ; } }
Length of the longest alternating even odd subarray | Java program to find the Length of the longest alternating even odd subarray ; Function to find the longest subarray ; Length of longest alternating subarray ; Iterate in the array ; increment count if consecutive elements has an odd sum ; Store maximum count in longest ; Reinitialize cnt as 1 consecutive elements does not have an odd sum ; Length of ' longest ' can never be 1 since even odd has to occur in pair or more so return 0 if longest = 1 ; Driver code
import java . util . * ; class GFG { static int longestEvenOddSubarray ( int a [ ] , int n ) { int longest = 1 ; int cnt = 1 ; for ( int i = 0 ; i < n - 1 ; i ++ ) { if ( ( a [ i ] + a [ i + 1 ] ) % 2 == 1 ) { cnt ++ ; } else { longest = Math . max ( longest , cnt ) ; cnt = 1 ; } } if ( longest == 1 ) return 0 ; return Math . max ( cnt , longest ) ; } public static void main ( String [ ] args ) { int a [ ] = { 1 , 2 , 3 , 4 , 5 , 7 , 8 } ; int n = a . length ; System . out . println ( longestEvenOddSubarray ( a , n ) ) ; } }
Check whether given number N is a Moran Number or not | Java implementation to check if the number is Moran number ; Function to calculate digit sum ; Function to check if number is prime ; Function to check if number is moran number ; Calculate digit sum ; Check if n is completely divisible by digit sum ; Calculate the quotient ; Check if the number is prime ; Driver code
import java . util . * ; import java . lang . * ; class GFG { static int digSum ( int a ) { int sum = 0 ; while ( a != 0 ) { sum += a % 10 ; a = a / 10 ; } return sum ; } static boolean isPrime ( int r ) { boolean s = true ; for ( int i = 2 ; i * i <= r ; i ++ ) { if ( r % i == 0 ) { s = false ; break ; } } return s ; } static void moranNo ( int n ) { int dup = n ; int sum = digSum ( dup ) ; if ( n % sum == 0 ) { int c = n / sum ; if ( isPrime ( c ) ) { System . out . println ( " Yes " ) ; return ; } } System . out . println ( " No " ) ; } public static void main ( String [ ] args ) { int n = 21 ; moranNo ( n ) ; } }
Program to check if N is a Hendecagonal Number | Java program for the above approach ; Function to check if N is a hendecagonal number ; Condition to check if the number is a hendecagonal number ; Driver code ; Given number ; Function call
import java . lang . Math ; class GFG { public static boolean ishendecagonal ( int N ) { double n = ( 7 + Math . sqrt ( 72 * N + 49 ) ) / 18 ; return ( n - ( int ) n ) == 0 ; } public static void main ( String [ ] args ) { int N = 11 ; if ( ishendecagonal ( N ) ) { System . out . println ( " Yes " ) ; } else { System . out . println ( " No " ) ; } } }
Program to check if N is a Hexadecagonal Number | Java program for the above approach ; Function to check if N is a hexadecagonal number ; Condition to check if the number is a hexadecagonal number ; Driver code ; Given number ; Function call
import java . lang . Math ; class GFG { public static boolean ishexadecagonal ( int N ) { double n = ( 12 + Math . sqrt ( 112 * N + 144 ) ) / 28 ; return ( n - ( int ) n ) == 0 ; } public static void main ( String [ ] args ) { int N = 16 ; if ( ishexadecagonal ( N ) ) { System . out . println ( " Yes " ) ; } else { System . out . println ( " No " ) ; } } }
Program to check if N is a Nonagonal Number | Java program for the above approach ; Function to check if N is a nonagonal number ; Condition to check if the number is a nonagonal number ; Driver code ; Given number ; Function call
import java . lang . Math ; class GFG { public static boolean isnonagonal ( int N ) { double n = ( 5 + Math . sqrt ( 56 * N + 25 ) ) / 14 ; return ( n - ( int ) n ) == 0 ; } public static void main ( String [ ] args ) { int N = 9 ; if ( isnonagonal ( N ) ) { System . out . println ( " Yes " ) ; } else { System . out . println ( " No " ) ; } } }
Count of decreasing pairs formed from numbers 1 to N | Java program to count decreasing pairs formed from numbers 1 to N ; Function to count the possible number of pairs ; if the number is even then the answer in ( N / 2 ) - 1 ; if the number is odd then the answer in N / 2 ; Driver code
import java . util . * ; class GFG { static void divParts ( int N ) { if ( N % 2 == 0 ) System . out . println ( ( N / 2 ) - 1 ) ; else System . out . println ( ( N / 2 ) ) ; } public static void main ( String [ ] args ) { int N = 8 ; divParts ( N ) ; } }
Count the minimum steps to reach 0 from the given integer N | Java program to count the minimum steps to reach 0 from the given integer N ; Function returns min step to reach 0 from N ; Direct possible reduction of value N ; Remaining steps needs to be reduced by 1 ; Summation of both the values ; Return the final answer ; Driver code
class GFG { static int getMinSteps ( int n , int jump ) { int quotient = n / jump ; int remainder = n % jump ; int steps = quotient + remainder ; return steps ; } public static void main ( String [ ] args ) { int N = 6 , K = 3 ; System . out . print ( getMinSteps ( N , K ) ) ; } }
Construct an Array of size N whose sum of cube of all elements is a perfect square | Java implementation of the above approach ; Function to construct an array of size N ; Prints the first N natural numbers ; Driver Code
class GFG { public static void constructArray ( int N ) { for ( int i = 1 ; i <= N ; i ++ ) { System . out . print ( i + " ▁ " ) ; } } public static void main ( String [ ] args ) { int N = 5 ; constructArray ( N ) ; } }
Program to check if N is a Centered Decagonal Number | Java implementation to check that a number is a centered decagonal number or not ; Function to check that the number is a centered decagonal number ; Condition to check if the number is a centered decagonal number ; Driver Code ; Function call
import java . lang . Math ; class GFG { public static boolean isCentereddecagonal ( int N ) { double n = ( 5 + Math . sqrt ( 20 * N + 5 ) ) / 10 ; return ( n - ( int ) n ) == 0 ; } public static void main ( String [ ] args ) { int n = 11 ; if ( isCentereddecagonal ( n ) ) { System . out . println ( " Yes " ) ; } else { System . out . println ( " No " ) ; } } }
Count Sexy Prime Pairs in the given array | Java program to count Sexy Prime pairs in array ; A utility function to check if the number n is prime or not ; Base Cases ; Check to skip middle five numbers in below loop ; If n is divisible by i and i + 2 then it is not prime ; A utility function that check if n1 and n2 are SPP ( Sexy Prime Pair ) or not ; Function to find SPP ( Sexy Prime Pair ) pairs from the given array ; Iterate through all pairs ; Increment count if SPP ( Sexy Prime Pair ) pair ; Driver code ; Function call to find SPP ( Sexy Prime Pair ) pair
import java . util . * ; class GFG { static boolean isPrime ( int n ) { if ( n <= 1 ) return false ; if ( n <= 3 ) return true ; if ( n % 2 == 0 n % 3 == 0 ) return false ; for ( int i = 5 ; i * i <= n ; i += 6 ) { if ( n % i == 0 || n % ( i + 6 ) == 0 ) { return false ; } } return true ; } static boolean SexyPrime ( int n1 , int n2 ) { return ( isPrime ( n1 ) && isPrime ( n2 ) && Math . abs ( n1 - n2 ) == 6 ) ; } static int countSexyPairs ( int arr [ ] , int n ) { int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = i + 1 ; j < n ; j ++ ) { if ( SexyPrime ( arr [ i ] , arr [ j ] ) ) { count ++ ; } } } return count ; } public static void main ( String [ ] args ) { int arr [ ] = { 6 , 7 , 5 , 11 , 13 } ; int n = arr . length ; System . out . print ( countSexyPairs ( arr , n ) ) ; } }
Find the K | Java program to Find the kth Permutation Sequence of first n natural numbers ; Function to find the index of number at first position of kth sequence of set of size n ; n_actual_fact = n ! ; First position of the kth sequence will be occupied by the number present at index = k / ( n - 1 ) ! ; Function to find the kth permutation of n numbers ; Store final answer ; Insert all natural number upto n in set ; Mark the first position ; Subtract 1 to get 0 based indexing ; itr now points to the number at index in set s ; Remove current number from the set ; Driver code
import java . util . * ; class GFG { static int findFirstNumIndex ( int k , int n ) { if ( n == 1 ) return 0 ; n -- ; int first_num_index ; int n_partial_fact = n ; while ( k >= n_partial_fact && n > 1 ) { n_partial_fact = n_partial_fact * ( n - 1 ) ; n -- ; } first_num_index = k / n_partial_fact ; k = k % n_partial_fact ; return first_num_index ; } static String findKthPermutation ( int n , int k ) { String ans = " " ; HashSet < Integer > s = new HashSet < > ( ) ; for ( int i = 1 ; i <= n ; i ++ ) s . add ( i ) ; Vector < Integer > v = new Vector < > ( ) ; v . addAll ( s ) ; int itr = v . elementAt ( 0 ) ; k = k - 1 ; for ( int i = 0 ; i < n ; i ++ ) { int index = findFirstNumIndex ( k , n - i ) ; if ( index < v . size ( ) ) { ans += ( ( v . elementAt ( index ) . toString ( ) ) ) ; v . remove ( index ) ; } else ans += String . valueOf ( itr + 2 ) ; itr = v . elementAt ( 0 ) ; } return ans ; } public static void main ( String [ ] args ) { int n = 3 , k = 4 ; String kth_perm_seq = findKthPermutation ( n , k ) ; System . out . print ( kth_perm_seq + "NEW_LINE"); } }
Find the Largest N digit perfect square number in Base B | Java implementation to find largest N digit perfect square number in base B ; Function to find the largest N digit number ; Largest n - digit perfect square ; Print the result ; Driver code
import java . io . * ; import java . util . * ; class GFG { static double nDigitPerfectSquares ( int n , int b ) { double largest = Math . pow ( Math . ceil ( Math . sqrt ( Math . pow ( b , n ) ) ) - 1 , 2 ) ; return largest ; } public static void main ( String [ ] args ) { int N = 1 , B = 8 ; System . out . println ( nDigitPerfectSquares ( N , B ) ) ; } }
Find Cube root of a number using Log function | Java program to Find Cube root of a number using Logarithm ; Function to find the cube root ; Calculate the cube root ; Return the final answer ; Driver code
class GFG { static double cubeRoot ( double n ) { double ans = Math . pow ( 3 , ( ( 1.0 / 3 ) * ( Math . log ( n ) / Math . log ( 3 ) ) ) ) ; return ans ; } public static void main ( String [ ] args ) { double N = 8 ; System . out . printf ( " % .2f " , cubeRoot ( N ) ) ; } }
Find the maximum possible value for the given periodic function | Java program to find the maximum possible value for the given function ; Function to return the maximum value of f ( x ) ; Driver Code
class GFG { public static int floorMax ( int A , int B , int N ) { int x = Math . min ( B - 1 , N ) ; return ( A * x ) / B ; } public static void main ( String [ ] args ) { int A = 11 , B = 10 , N = 9 ; System . out . println ( floorMax ( A , B , N ) ) ; } }
Minimum moves taken to move coin of each cell to any one cell of Matrix | Java program to find the minimum number of moves taken to move the element of each cell to any one cell of the square matrix of odd length ; Function to find the minimum number of moves taken to move the element of each cell to any one cell of the square matrix of odd length ; Initializing count to 0 ; Number of layers that are around the centre element ; Iterating over ranger of layers ; Increase the value of count by 8 * k * k ; Driver code
class GFG { public static int calculateMoves ( int n ) { int count = 0 ; int layers = n / 2 ; for ( int k = 1 ; k < layers + 1 ; k ++ ) { count += 8 * k * k ; } return count ; } public static void main ( String [ ] args ) { int N = 5 ; System . out . println ( calculateMoves ( N ) ) ; } }
Check if N can be represented as sum of squares of two consecutive integers | Java implementation to check that a number is sum of squares of 2 consecutive numbers or not ; Function to check that the a number is sum of squares of 2 consecutive numbers or not ; Condition to check if the a number is sum of squares of 2 consecutive numbers or not ; Driver code ; Function call
import java . lang . Math ; class GFG { public static boolean isSumSquare ( int N ) { double n = ( 2 + Math . sqrt ( 8 * N - 4 ) ) / 2 ; return ( n - ( int ) n ) == 0 ; } public static void main ( String [ ] args ) { int i = 13 ; if ( isSumSquare ( i ) ) { System . out . println ( " Yes " ) ; } else { System . out . println ( " No " ) ; } } }
Program to check if N is a Centered heptagonal number | Java implementation to check that a number is a Centered heptagonal number or not ; Function to check that the number is a Centered heptagonal number ; Condition to check if the number is a Centered heptagonal number ; Driver Code ; Function call
import java . lang . Math ; class GFG { public static boolean isCenteredheptagonal ( int N ) { double n = ( 7 + Math . sqrt ( 56 * N - 7 ) ) / 14 ; return ( n - ( int ) n ) == 0 ; } public static void main ( String [ ] args ) { int n = 8 ; if ( isCenteredheptagonal ( n ) ) { System . out . println ( " Yes " ) ; } else { System . out . println ( " No " ) ; } } }
Program to check if N is a Centered nonadecagonal number | Java implementation to check that a number is a Centered nonadecagonal number or not ; Function to check that the number is a Centered nonadecagonal number ; Condition to check if the number is a Centered nonadecagonal number ; Driver Code ; Function call
class GFG { static boolean isCenterednonadecagonal ( int N ) { float n = ( float ) ( ( 19 + Math . sqrt ( 152 * N + 209 ) ) / 38 ) ; return ( n - ( int ) n ) == 0 ; } public static void main ( String [ ] args ) { int n = 20 ; if ( isCenterednonadecagonal ( n ) ) { System . out . print ( " Yes " ) ; } else { System . out . print ( " No " ) ; } } }
Program to check if N is a Centered Octadecagonal number | Java implementation to check that a number is a centered octadecagonal number or not ; Function to check that the number is a centered octadecagonal number ; Implement the formula generated ; Condition to check if the number is a Centered Octadecagonal number ; Driver Code ; Function call
import java . lang . Math ; class GFG { public static boolean isCenteredOctadecagonal ( int N ) { double n = ( 9 + Math . sqrt ( 36 * N + 45 ) ) / 18 ; return ( n - ( int ) n ) == 0 ; } public static void main ( String [ ] args ) { int n = 19 ; if ( isCenteredOctadecagonal ( n ) ) { System . out . println ( " Yes " ) ; } else { System . out . println ( " No " ) ; } } }
Logarithm tricks for Competitive Programming | Java implementation to find Kth root of the number ; Function to find the Kth root of the number ; Driver Code
class GFG { static double kthRoot ( double n , int k ) { return Math . pow ( k , ( 1.0 / k ) * ( Math . log ( n ) / Math . log ( k ) ) ) ; } public static void main ( String [ ] args ) { double N = 8.0 ; int K = 3 ; System . out . print ( kthRoot ( N , K ) ) ; } }
Logarithm tricks for Competitive Programming | Java implementation to check if the number is power of K ; Function to check if the number is power of K ; Logarithm function to calculate value ; Compare to the result1 or result2 both are equal ; Driver Code
class GFG { static boolean isPower ( int N , int K ) { int res1 = ( int ) ( Math . log ( N ) / Math . log ( K ) ) ; double res2 = Math . log ( N ) / Math . log ( K ) ; return ( res1 == res2 ) ; } public static void main ( String [ ] args ) { int N = 8 ; int K = 2 ; if ( isPower ( N , K ) ) { System . out . println ( " Yes " ) ; } else { System . out . println ( " No " ) ; } } }