dhyuti-n/xlcost-variable-roles huggingface dataset:
Java program:
import java . util . * ; public class GFG { static int Wythoff ( HashMap < Integer , HashMap < Integer , Integer > > mp , int n , int k ) { double tau = ( Math . sqrt ( 5 ) + 1 ) / 2.0 , t_n_k ; if ( mp . containsKey ( n ) && mp . get ( n ) . containsKey ( k ) && mp . get ( n ) . get ( k ) != 0 ) return mp . get ( n ) . get ( k ) ; if ( k == - 1 ) { return n - 1 ; } else if ( k == 0 ) { t_n_k = Math . floor ( n * tau ) ; } else { t_n_k = Wythoff ( mp , n , k - 1 ) + Wythoff ( mp , n , k - 2 ) ; } mp . put ( n , new HashMap < Integer , Integer > ( k , ( int ) t_n_k ) ) ; return ( int ) t_n_k ; } static void Wythoff_Array ( int n ) { int i = 0 , j = 0 , count = 0 ; HashMap < Integer , HashMap < Integer , Integer > > mp = new HashMap < Integer , HashMap < Integer , Integer > > ( ) ; while ( count < n ) { System . out . print ( Wythoff ( mp , i + 1 , j + 1 ) ) ; count ++ ; if ( count != n ) System . out . print ( " , ▁ " ) ; i ++ ; j -- ; if ( j < 0 ) { j = i ; i = 0 ; } } } public static void main ( String [ ] args ) { int n = 15 ; Wythoff_Array ( n ) ; } }

Accumulator variables: count, i, j
Class/struct names: GFG
Java program:
class GFG { static double sum ( double a , double b , double c , double d , double x ) { double ans = ( x * ( a + b ) * ( c - d ) ) / ( ( a * d ) - ( b * c ) ) ; return ans ; } public static void main ( String [ ] args ) { double a = 1 , b = 2 , c = 9 , d = 13 , x = 5 ; System . out . println ( sum ( a , b , c , d , x ) ) ; } }

Class/struct names: GFG
Java program:
import java . util . * ; public class GFG { static boolean is_Prime ( int n ) { if ( n < 2 ) return false ; for ( int i = 2 ; i <= Math . sqrt ( n ) ; i ++ ) if ( n % i == 0 ) return false ; return true ; } static void set_primes ( HashMap < Integer , HashMap < Integer , Integer > > mp , HashMap < Integer , HashMap < Integer , Integer > > hash , int c ) { int count = 0 ; for ( int i = 2 ; count < c ; i ++ ) { if ( is_Prime ( i ) ) { if ( ! mp . containsKey ( 0 ) ) { mp . put ( 0 , new HashMap < Integer , Integer > ( ) ) ; } if ( ! mp . get ( 0 ) . containsKey ( count ) ) { mp . get ( 0 ) . put ( count , i ) ; } else { mp . get ( 0 ) . put ( count , i ) ; } count ++ ; if ( ! hash . containsKey ( 0 ) ) { hash . put ( 0 , new HashMap < Integer , Integer > ( ) ) ; } if ( ! hash . get ( 0 ) . containsKey ( count - 1 ) ) { hash . get ( 0 ) . put ( count - 1 , 1 ) ; } else { hash . get ( 0 ) . put ( count - 1 , 1 ) ; } } } } static int Gilbreath ( HashMap < Integer , HashMap < Integer , Integer > > mp , HashMap < Integer , HashMap < Integer , Integer > > hash , int n , int k ) { if ( hash . containsKey ( n ) && hash . get ( n ) . containsKey ( k ) && hash . get ( n ) . get ( k ) != 0 ) return mp . get ( n ) . get ( k ) ; int ans = Math . abs ( Gilbreath ( mp , hash , n - 1 , k + 1 ) - Gilbreath ( mp , hash , n - 1 , k ) ) ; if ( ! mp . containsKey ( n ) ) { mp . put ( n , new HashMap < Integer , Integer > ( ) ) ; } mp . get ( n ) . put ( k , ans ) ; return ans ; } static void solve ( int n ) { int i = 0 , j = 0 , count = 0 ; HashMap < Integer , HashMap < Integer , Integer > > mp = new HashMap < Integer , HashMap < Integer , Integer > > ( ) ; HashMap < Integer , HashMap < Integer , Integer > > hash = new HashMap < Integer , HashMap < Integer , Integer > > ( ) ; set_primes ( mp , hash , 100 ) ; while ( count < n ) { System . out . print ( Gilbreath ( mp , hash , i , j ) + " , ▁ " ) ; count ++ ; i -- ; j ++ ; if ( i < 0 ) { i = j ; j = 0 ; } } } public static void main ( String [ ] args ) { int n = 15 ; solve ( n ) ; } }

Accumulator variables: count, i, j
Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { static void printRoots ( long a , long b , long c ) { System . out . println ( 1 + " , ▁ " + c / ( a * 1.0 ) ) ; } public static void main ( String [ ] args ) { long a = 2 ; long b = 3 ; long c = - 5 ; printRoots ( a , b , c ) ; } }

Class/struct names: GFG
Java program:
class GFG { static int longestAlternativeSequence ( int a [ ] , int n ) { int maxi1 = 0 ; int f1 = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( f1 % 2 != 0 ) { if ( a [ i ] % 2 == 1 ) { f1 = 1 ; maxi1 ++ ; } } else { if ( a [ i ] % 2 == 0 ) { maxi1 ++ ; f1 = 0 ; } } } int maxi2 = 0 ; int f2 = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( f2 % 2 != 0 ) { if ( a [ i ] % 2 == 1 ) { f2 = 1 ; maxi2 ++ ; } } else { if ( a [ i ] % 2 == 0 ) { maxi2 ++ ; f2 = 0 ; } } } return Math . max ( maxi1 , maxi2 ) ; } public static void main ( String [ ] args ) { int a [ ] = { 13 , 16 , 8 , 9 , 32 , 10 } ; int n = a . length ; System . out . println ( longestAlternativeSequence ( a , n ) ) ; } }

Index/key variables: i
Accumulator variables: i, maxi1, maxi2
Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { static String nambiarNumber ( String str , int i ) { if ( i >= str . length ( ) ) return " " ; int firstDigit = ( str . charAt ( i ) - '0' ) ; int digitParity = firstDigit % 2 ; int sumDigits = 0 ; while ( i < str . length ( ) ) { sumDigits += ( str . charAt ( i ) - '0' ) ; int sumParity = sumDigits % 2 ; if ( digitParity != sumParity ) { break ; } i ++ ; } return ( " " + sumDigits + nambiarNumber ( str , i + 1 ) ) ; } public static void main ( String [ ] args ) { String str = "9880127431" ; System . out . println ( nambiarNumber ( str , 0 ) ) ; } }

Accumulator variables: i, sumDigits
Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static float Depreciation ( float v , float r , float t ) { float D = ( float ) ( v * Math . pow ( ( 1 - r / 100 ) , t ) ) ; return D ; } public static void main ( String [ ] args ) { float V1 = 200 , R = 10 , T = 2 ; System . out . print ( Depreciation ( V1 , R , T ) ) ; } }

Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static int phi ( int n ) { for ( int p = 2 ; p * p <= n ; ++ p ) { if ( n % p == 0 ) { while ( n % p == 0 ) n /= p ; result -= result / p ; } } if ( n > 1 ) result -= result / n ; return result ; } static void Highly_Totient ( int n ) { int count = 0 , p_count = - 1 ; HashMap < Integer , Integer > mp = new HashMap < Integer , Integer > ( ) ; for ( int i = 1 ; i < 100000 ; i ++ ) { if ( mp . containsKey ( phi ( i ) ) ) { mp . put ( phi ( i ) , mp . get ( phi ( i ) ) + 1 ) ; } else { mp . put ( phi ( i ) , 1 ) ; } } int i = 1 ; while ( count < n ) { if ( mp . containsKey ( i ) && mp . get ( i ) > p_count ) { System . out . print ( i ) ; if ( count < n - 1 ) System . out . print ( " , ▁ " ) ; p_count = mp . get ( i ) ; count ++ ; } i ++ ; } } public static void main ( String [ ] args ) { int n = 20 ; Highly_Totient ( n ) ; } }

Accumulator variables: count, i, n, result
Iterator variables: i, p
Class/struct names: GFG
Java program:
class GFG { static int speedOfTrain ( float X , float Y ) { float Speed ; Speed = 1188 * ( ( X - Y ) / Y ) ; return ( int ) Speed ; } public static void main ( String [ ] args ) { float X = 8f , Y = 7.2f ; int result = ( speedOfTrain ( X , Y ) ) ; System . out . println ( result + " ▁ km / hr " ) ; } }

Class/struct names: GFG
Java program:
import java . util . * ; import java . lang . * ; import java . io . * ; class GFG { static int Division ( int a [ ] , int n ) { int maxi = Integer . MIN_VALUE , mini = Integer . MAX_VALUE ; for ( int i = 0 ; i < n ; i ++ ) { maxi = Math . max ( a [ i ] , maxi ) ; mini = Math . min ( a [ i ] , mini ) ; } return maxi / mini ; } public static void main ( String [ ] args ) throws java . lang . Exception { int a [ ] = { 3 , 7 , 9 , 3 , 11 } ; int n = a . length ; System . out . print ( Division ( a , n ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static final int CARDS = 100 ; static void currentRound ( List < Integer > list , int totalPiles ) { List < List < Integer > > piles = new ArrayList < > ( ) ; for ( int i = 0 ; i < totalPiles ; i ++ ) piles . add ( new ArrayList < Integer > ( ) ) ; int j = 0 ; for ( int i = 0 ; i < CARDS ; i ++ ) { piles . get ( j ) . add ( list . get ( i ) ) ; j = ( j + 1 ) % totalPiles ; } int pileNo = 0 , i = 0 ; j = 0 ; while ( i < CARDS ) { list . set ( i , piles . get ( pileNo ) . get ( j ) ) ; j ++ ; if ( j >= piles . get ( pileNo ) . size ( ) ) { pileNo ++ ; j = 0 ; } i ++ ; } } static int performRounds ( int piles [ ] , int rounds , int n ) { List < Integer > list = new ArrayList < > ( ) ; for ( int i = 1 ; i <= CARDS ; i ++ ) list . add ( i ) ; for ( int i = 0 ; i < rounds ; i ++ ) currentRound ( list , piles [ i ] ) ; return list . get ( n ) ; } public static void main ( String [ ] args ) { int piles [ ] = { 2 , 2 } ; int rounds = piles . length ; int n = 4 ; n -- ; System . out . print ( performRounds ( piles , rounds , n ) ) ; } }

Index/key variables: i
Accumulator variables: i, j, n, pileNo
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static int MAX = 1000000 ; static Vector < Integer > addPrimes ( ) { int n = MAX ; boolean [ ] prime = new boolean [ n + 1 ] ; Arrays . fill ( prime , true ) ; for ( int p = 2 ; p * p <= n ; p ++ ) { if ( prime [ p ] == true ) { for ( int i = p * p ; i <= n ; i += p ) prime [ i ] = false ; } } Vector < Integer > ans = new Vector < Integer > ( ) ; for ( int p = 2 ; p <= n ; p ++ ) if ( prime [ p ] ) ans . add ( p ) ; return ans ; } static int pi ( int x , Vector < Integer > v ) { int l = 0 , r = v . size ( ) - 1 , m , in = - 1 ; while ( l <= r ) { m = ( l + r ) / 2 ; if ( v . get ( m ) <= x ) { in = m ; l = m + 1 ; } else { r = m - 1 ; } } return in + 1 ; } static int Ramanujan ( int n , Vector < Integer > v ) { int upperbound = ( int ) ( 4 * n * ( Math . log ( 4 * n ) / Math . log ( 2 ) ) ) ; for ( int i = upperbound ; ; i -- ) { if ( pi ( i , v ) - pi ( i / 2 , v ) < n ) return 1 + i ; } } static void Ramanujan_Numbers ( int n ) { int c = 1 ; Vector < Integer > v = addPrimes ( ) ; for ( int i = 1 ; i <= n ; i ++ ) { System . out . print ( Ramanujan ( i , v ) ) ; if ( i != n ) System . out . print ( " , ▁ " ) ; } } public static void main ( String [ ] args ) { int n = 10 ; Ramanujan_Numbers ( n ) ; } }

Index/key variables: i, p
Accumulator variables: i, p
Iterator variables: i, p
Class/struct names: GFG
Java program:
import java . util . * ; import java . lang . * ; import java . io . * ; class GFG { static int MAX = 130 ; static boolean validQuadruple ( int arr [ ] , int n ) { if ( n >= MAX ) return true ; for ( int i = 0 ; i < n ; i ++ ) for ( int j = i + 1 ; j < n ; j ++ ) for ( int k = j + 1 ; k < n ; k ++ ) for ( int l = k + 1 ; l < n ; l ++ ) { if ( ( arr [ i ] ^ arr [ j ] ^ arr [ k ] ^ arr [ l ] ) == 0 ) { return true ; } } return false ; } public static void main ( String [ ] args ) throws java . lang . Exception { int arr [ ] = { 1 , 0 , 2 , 3 , 7 } ; int n = arr . length ; if ( validQuadruple ( arr , n ) ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } }

Index/key variables: i, j, k, l
Accumulator variables: i, j, k, l
Iterator variables: i, j, k, l
Class/struct names: GFG
Java program:
import java . util . HashMap ; import java . util . LinkedList ; import java . util . List ; import java . util . Map ; public class QuadrapuleXor { static boolean check ( int arr [ ] ) { int n = arr . length ; if ( n < 4 ) return false ; if ( n >= 130 ) return true ; Map < Integer , List < Integer > > map = new HashMap < > ( ) ; for ( int i = 0 ; i < n - 1 ; i ++ ) { for ( int j = i + 1 ; j < n ; j ++ ) { int k = arr [ i ] ^ arr [ j ] ; if ( ! map . containsKey ( k ) ) map . put ( k , new LinkedList < > ( ) ) ; List < Integer > data = map . get ( k ) ; if ( ! data . contains ( i ) && ! data . contains ( j ) ) { data . add ( i ) ; data . add ( j ) ; if ( data . size ( ) >= 4 ) return true ; map . put ( k , data ) ; } } } return false ; } public static void main ( String [ ] args ) throws java . lang . Exception { int arr [ ] = { 1 , 0 , 2 , 3 , 7 } ; if ( check ( arr ) ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } }

Index/key variables: i, j
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: QuadrapuleXor
Java program:
import java . util . * ; import java . lang . * ; import java . io . * ; 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 int NumberOfWays ( int X , int Y , int M , int N ) { return fact ( X + Y ) * nCr ( M , X ) * nCr ( N , Y ) ; } public static void main ( String [ ] args ) throws java . lang . Exception { int X = 2 , Y = 2 , M = 3 , N = 3 ; System . out . println ( NumberOfWays ( X , Y , M , N ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static int fact ( int n ) { int i = 1 , fac = 1 ; for ( i = 1 ; i <= n ; i ++ ) fac = fac * i ; return fac ; } static double log_Expansion ( double x , int n ) { double sum = 0 ; int i = 0 ; for ( i = 0 ; i < n ; i ++ ) { sum = sum + Math . pow ( x , 2 * i ) / fact ( 2 * i ) ; } return sum ; } public static void main ( String [ ] args ) { double x = 1 ; int n = 10 ; System . out . println ( log_Expansion ( x , n ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static boolean prime ( int n ) { for ( int i = 2 ; i * i <= n ; i ++ ) if ( n % i == 0 ) return false ; return true ; } static void prime_range ( int start , int end , int [ ] a ) { for ( int i = start ; i < end ; i ++ ) { if ( prime ( a [ i ] ) ) System . out . print ( a [ i ] + " ▁ " ) ; } } static void Print ( int arr [ ] , int n ) { System . out . print ( " Prime ▁ numbers ▁ in ▁ the ▁ first ▁ half ▁ are ▁ " ) ; prime_range ( 0 , n / 2 , arr ) ; System . out . println ( ) ; System . out . print ( " Prime ▁ numbers ▁ in ▁ the ▁ second ▁ half ▁ are ▁ " ) ; prime_range ( n / 2 , n , arr ) ; System . out . println ( ) ; } public static void main ( String [ ] args ) { int arr [ ] = { 2 , 5 , 10 , 15 , 17 , 21 , 23 } ; int n = arr . length ; Print ( arr , n ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { static int countElements ( int arr [ ] , int n ) { int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) sum += arr [ i ] ; float mean = ( float ) sum / n ; int cnt = 0 ; for ( int i = 0 ; i < n ; i ++ ) { float newMean = ( float ) ( sum - arr [ i ] ) / ( n - 1 ) ; if ( newMean == mean ) cnt ++ ; } return cnt ; } public static void main ( String [ ] args ) { int arr [ ] = { 1 , 2 , 3 , 4 , 5 } ; int n = arr . length ; System . out . println ( countElements ( arr , n ) ) ; } }

Index/key variables: i
Accumulator variables: cnt, i, sum
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static int MAX = 10000 ; static int MAX_ELEMENT = 50 ; static int [ ] [ ] [ ] dp = new int [ MAX_ELEMENT ] [ MAX_ELEMENT ] [ MAX ] ; static int Max_Xor ( int arr [ ] , int i , int j , int mask , int n ) { if ( i >= n ) { if ( j == 0 ) return mask ; else return 0 ; } if ( dp [ i ] [ j ] [ mask ] != - 1 ) return dp [ i ] [ j ] [ mask ] ; int ans = 0 ; if ( j > 0 ) ans = Max_Xor ( arr , i + 1 , j - 1 , mask ^ arr [ i ] , n ) ; ans = Math . max ( ans , Max_Xor ( arr , i + 1 , j , mask , n ) ) ; return dp [ i ] [ j ] [ mask ] = ans ; } public static void main ( String [ ] args ) { int arr [ ] = { 2 , 5 , 4 , 1 , 3 , 7 , 6 , 8 } ; int n = arr . length ; int k = 3 ; for ( int i = 0 ; i < MAX_ELEMENT ; i ++ ) { for ( int j = 0 ; j < MAX_ELEMENT ; j ++ ) { for ( int l = 0 ; l < MAX ; l ++ ) dp [ i ] [ j ] [ l ] = - 1 ; } } System . out . println ( Max_Xor ( arr , 0 , k , 0 , n ) ) ; } }

Index/key variables: MAX, MAX_ELEMENT, i, j, l, mask
Accumulator variables: i, j, l
Iterator variables: i, j, l
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static boolean Prime ( int n ) { for ( int j = 2 ; j <= Math . sqrt ( n ) ; j ++ ) if ( n % j == 0 ) return false ; return true ; } static int find_prime ( int x , int xsqmodp , int y , int ysqmodp ) { int n = x * x - xsqmodp ; int n1 = y * y - ysqmodp ; for ( int j = 2 ; j <= Math . max ( Math . sqrt ( n ) , Math . sqrt ( n1 ) ) ; j ++ ) { if ( n % j == 0 && ( x * x ) % j == xsqmodp && n1 % j == 0 && ( y * y ) % j == ysqmodp ) if ( Prime ( j ) ) return j ; int j1 = n / j ; if ( n % j1 == 0 && ( x * x ) % j1 == xsqmodp && n1 % j1 == 0 && ( y * y ) % j1 == ysqmodp ) if ( Prime ( j1 ) ) return j1 ; j1 = n1 / j ; if ( n % j1 == 0 && ( x * x ) % j1 == xsqmodp && n1 % j1 == 0 && ( y * y ) % j1 == ysqmodp ) if ( Prime ( j1 ) ) return j1 ; } if ( n == n1 ) return n ; return Integer . MIN_VALUE ; } public static void main ( String [ ] args ) { int x = 3 , xsqmodp = 0 , y = 5 , ysqmodp = 1 ; System . out . println ( find_prime ( x , xsqmodp , y , ysqmodp ) ) ; } }

Accumulator variables: j
Iterator variables: j
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static int numberOfMinutes ( int S , int S1 ) { int Min = 0 ; Min = ( int ) ( ( ( S - S1 ) / Math . floor ( S ) ) * 60 ) ; return Min ; } public static void main ( String [ ] args ) { int S = 30 , S1 = 10 ; System . out . println ( numberOfMinutes ( S , S1 ) + " ▁ min " ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static int FindElement ( int a [ ] , int n ) { int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) sum = sum + a [ i ] ; if ( sum % n == 0 ) { int m = sum / n ; for ( int i = 0 ; i < n ; i ++ ) if ( a [ i ] == m ) return m ; } return - 1 ; } public static void main ( String [ ] args ) { int a [ ] = { 1 , 2 , 3 , 4 , 5 } ; int n = a . length ; System . out . print ( FindElement ( a , n ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { static int fac ( int num ) { if ( num == 0 ) return 1 ; int fact = 1 ; for ( int i = 1 ; i <= num ; i ++ ) fact = fact * i ; return fact ; } static void Tanx_expansion ( int terms , int x ) { double sum = 0 ; for ( int i = 1 ; i <= terms ; i += 1 ) { double B = 0 ; int Bn = 2 * i ; for ( int k = 0 ; k <= Bn ; k ++ ) { double temp = 0 ; for ( int r = 0 ; r <= k ; r ++ ) temp = temp + Math . pow ( - 1 , r ) * fac ( k ) * Math . pow ( r , Bn ) / ( fac ( r ) * fac ( k - r ) ) ; B = B + temp / ( ( double ) ( k + 1 ) ) ; } sum = sum + Math . pow ( - 4 , i ) * ( 1 - Math . pow ( 4 , i ) ) * B * Math . pow ( x , 2 * i - 1 ) / fac ( 2 * i ) ; } System . out . printf ( " % .9f " , sum ) ; } public static void main ( String [ ] args ) { int n = 6 , x = 1 ; Tanx_expansion ( n , x ) ; } }

Accumulator variables: i, k, r
Iterator variables: i, k, r
Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static int gcd ( int a , int b ) { if ( b == 0 ) return a ; return gcd ( b , a % b ) ; } static int minimum_elements ( int n , int arr [ ] ) { if ( n < 3 ) return 0 ; int g , ans = 0 , diff , cnt ; diff = arr [ 1 ] - arr [ 0 ] ; g = diff ; for ( int i = 2 ; i < n ; i ++ ) { diff = arr [ i ] - arr [ i - 1 ] ; g = gcd ( g , diff ) ; } for ( int i = 1 ; i < n ; i ++ ) { diff = arr [ i ] - arr [ i - 1 ] ; cnt = diff / g ; ans += ( cnt - 1 ) ; } return ans ; } public static void main ( String [ ] args ) { int arr [ ] = { 1 , 5 , 8 , 10 , 12 , 16 } ; int n = arr . length ; System . out . println ( minimum_elements ( n , arr ) ) ; } }

Index/key variables: i
Accumulator variables: ans, i
Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { static boolean checkcomposite ( int n ) { for ( int i = 2 ; i <= Math . sqrt ( n ) ; i ++ ) { if ( n % i == 0 ) { return true ; } } return false ; } static int power ( int x , int y , int mod ) { int res = 1 ; while ( y != 0 ) { if ( ( y & 1 ) == 1 ) { res = ( res * x ) % mod ; } y = y >> 1 ; x = ( x * x ) % mod ; } return res ; } static int Check ( int n , int a ) { if ( a > 1 && checkcomposite ( n ) && power ( a , n - 1 , n ) == 1 ) { return 1 ; } return 0 ; } public static void main ( String [ ] args ) { int N = 645 ; int a = 2 ; System . out . println ( Check ( N , a ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; import java . lang . * ; import java . io . * ; class Gfg { static void Digits ( int n ) { int largest = 0 ; int smallest = 9 ; while ( n != 0 ) { int r = n % 10 ; largest = Math . max ( r , largest ) ; smallest = Math . min ( r , smallest ) ; n = n / 10 ; } System . out . println ( largest + " ▁ " + smallest ) ; } public static void main ( String [ ] args ) throws java . lang . Exception { int n = 2346 ; Digits ( n ) ; } }

Class/struct names: Gfg
Java program:
class GFG { public static int factorial ( int n ) { if ( n <= 1 ) return 1 ; return n * factorial ( n - 1 ) ; } public static int nCr ( int n , int r ) { return factorial ( n ) / ( factorial ( r ) * factorial ( n - r ) ) ; } public static float Probability ( int M , int N , int X ) { return ( float ) ( nCr ( M - N - 1 , X - 2 ) / ( nCr ( M - 1 , X - 1 ) * 1.0 ) ) ; } public static void main ( String [ ] args ) { int M = 9 , X = 3 , N = 4 ; System . out . println ( Probability ( M , N , X ) ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static int fact ( int n ) { int res = 1 ; for ( int i = 2 ; i <= n ; i ++ ) res = res * i ; return res ; } static int Count_number ( int N ) { return ( N * fact ( N ) ) ; } public static void main ( String [ ] args ) { int N = 2 ; System . out . print ( Count_number ( N ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { static int fact ( int n ) { if ( n <= 1 ) return 1 ; return n * fact ( n - 1 ) ; } static int nPr ( int n , int r ) { return fact ( n ) / fact ( n - r ) ; } static int countWords ( int N , int M ) { return ( int ) Math . pow ( N , M ) - nPr ( N , M ) ; } public static void main ( String [ ] args ) { int N = 10 , M = 5 ; System . out . print ( countWords ( N , M ) ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static void find_length ( int s1 , int s2 ) { if ( s1 <= 0 s2 <= 0 ) { System . out . print ( - 1 ) ; return ; } int max_length = s1 + s2 - 1 ; int min_length = Math . max ( s1 , s2 ) - Math . min ( s1 , s2 ) + 1 ; if ( min_length > max_length ) { System . out . print ( - 1 ) ; return ; } System . out . println ( " Max ▁ = ▁ " + max_length ) ; System . out . print ( " Min ▁ = ▁ " + min_length ) ; } public static void main ( String [ ] args ) { int s1 = 8 , s2 = 5 ; find_length ( s1 , s2 ) ; } }

Class/struct names: GFG
Java program:
class geeks { public static int firstSetBit ( int n ) { int x = n & ( n - 1 ) ; return ( n ^ x ) ; } public static void main ( String [ ] args ) { int n = 12 ; System . out . println ( firstSetBit ( n ) ) ; } }

Class/struct names: geeks
Java program:
import java . util . HashMap ; class geeks { public static int nCr ( int n , int r ) { int res = 1 ; for ( int i = 1 ; i <= r ; i ++ ) { res *= ( n - r + i ) ; res /= i ; } return res ; } public static int NoofSequences ( int N , int M ) { HashMap < Integer , Integer > prime = new HashMap < > ( ) ; for ( int i = 2 ; i <= Math . sqrt ( M ) ; i ++ ) { while ( M % i == 0 ) { if ( prime . get ( i ) == null ) prime . put ( i , 1 ) ; else { int x = prime . get ( i ) ; prime . put ( i , ++ x ) ; } M /= i ; } } if ( M > 1 ) { if ( prime . get ( M ) != null ) { int x = prime . get ( M ) ; prime . put ( M , ++ x ) ; } else prime . put ( M , 1 ) ; } int ans = 1 ; for ( HashMap . Entry < Integer , Integer > entry : prime . entrySet ( ) ) { ans *= ( nCr ( N + entry . getValue ( ) - 1 , N - 1 ) ) ; } return ans ; } public static void main ( String [ ] args ) { int N = 2 , M = 6 ; System . out . println ( NoofSequences ( N , M ) ) ; } }

Accumulator variables: M, ans, i, res
Iterator variables: i
Class/struct names: geeks
Java program:
import java . io . * ; class GFG { static int findHours ( int a , int b , int k ) { if ( a >= b ) return - 1 ; int time = k / ( b - a ) ; time = time + 1 ; return time ; } public static void main ( String [ ] args ) { int a = 4 , b = 5 , k = 1 ; System . out . println ( findHours ( a , b , k ) ) ; } }

Class/struct names: GFG