dhyuti-n/xlcost-variable-roles huggingface dataset:
Java program:
import java . util . * ; import java . util . Arrays ; import java . util . Collections ; class GFG { public static int calculateDifference ( int [ ] arr , int n ) { int max_val = Arrays . stream ( arr ) . max ( ) . getAsInt ( ) ; boolean [ ] prime = new boolean [ max_val + 1 ] ; Arrays . fill ( prime , true ) ; prime [ 0 ] = false ; prime [ 1 ] = false ; for ( int p = 2 ; p * p <= max_val ; p ++ ) { if ( prime [ p ] == true ) { for ( int i = p * 2 ; i <= max_val ; i += p ) prime [ i ] = false ; } } int P1 = 1 , P2 = 1 ; for ( int i = 0 ; i < n ; i ++ ) { if ( prime [ arr [ i ] ] ) { P1 *= arr [ i ] ; } else if ( arr [ i ] != 1 ) { P2 *= arr [ i ] ; } } return Math . abs ( P2 - P1 ) ; } public static void main ( String [ ] args ) { int [ ] arr = new int [ ] { 1 , 3 , 5 , 10 , 15 , 7 } ; int n = arr . length ; System . out . println ( calculateDifference ( arr , n ) ) ; System . exit ( 0 ) ; } }

Index/key variables: i, p
Accumulator variables: P1, P2, i, p
Iterator variables: i, p
Class/struct names: GFG
Java program:
public class GFG { static int EqualNumbers ( int a [ ] , int n ) { int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) sum += a [ i ] ; if ( sum % n != 0 ) return n - 1 ; return n ; } public static void main ( String args [ ] ) { int a [ ] = { 1 , 4 , 1 } ; int n = a . length ; System . out . println ( EqualNumbers ( a , n ) ) ; } }

Index/key variables: i
Accumulator variables: i, sum
Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { static int count_odd_pair ( int n , int a [ ] ) { int odd = 0 , even = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( a [ i ] % 2 == 0 ) even ++ ; else odd ++ ; } int ans = odd * even * 2 ; return ans ; } static int count_even_pair ( int odd_sum_pairs , int n ) { int total_pairs = ( n * ( n - 1 ) ) ; int ans = total_pairs - odd_sum_pairs ; return ans ; } public static void main ( String [ ] args ) { int n = 6 ; int [ ] a = { 2 , 4 , 5 , 9 , 1 , 8 } ; int odd_sum_pairs = count_odd_pair ( n , a ) ; int even_sum_pairs = count_even_pair ( odd_sum_pairs , n ) ; System . out . println ( " Even ▁ Sum ▁ Pairs ▁ = ▁ " + even_sum_pairs ) ; System . out . println ( " Odd ▁ Sum ▁ Pairs = ▁ " + odd_sum_pairs ) ; } }

Index/key variables: i
Accumulator variables: even, i, odd
Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { static int findSteps ( int n , int m , int a [ ] ) { int cur = 1 ; int steps = 0 ; for ( int i = 0 ; i < m ; i ++ ) { if ( a [ i ] >= cur ) steps += ( a [ i ] - cur ) ; else steps += ( n - cur + a [ i ] ) ; cur = a [ i ] ; } return steps ; } public static void main ( String [ ] args ) { int n = 3 , m = 3 ; int a [ ] = { 2 , 1 , 2 } ; System . out . println ( findSteps ( n , m , a ) ) ; } }

Index/key variables: i
Accumulator variables: i, steps
Iterator variables: i
Class/struct names: GFG
Java program:
public class Improve { static void HexToBin ( char hexdec [ ] ) { int i = 0 ; while ( hexdec [ i ] != ' \u0000' ) { switch ( hexdec [ i ] ) { case '0' : System . out . print ( "0000" ) ; break ; case '1' : System . out . print ( "0001" ) ; break ; case '2' : System . out . print ( "0010" ) ; break ; case '3' : System . out . print ( "0011" ) ; break ; case '4' : System . out . print ( "0100" ) ; break ; case '5' : System . out . print ( "0101" ) ; break ; case '6' : System . out . print ( "0110" ) ; break ; case '7' : System . out . print ( "0111" ) ; break ; case '8' : System . out . print ( "1000" ) ; break ; case '9' : System . out . print ( "1001" ) ; break ; case ' A ' : case ' a ' : System . out . print ( "1010" ) ; break ; case ' B ' : case ' b ' : System . out . print ( "1011" ) ; break ; case ' C ' : case ' c ' : System . out . print ( "1100" ) ; break ; case ' D ' : case ' d ' : System . out . print ( "1101" ) ; break ; case ' E ' : case ' e ' : System . out . print ( "1110" ) ; break ; case ' F ' : case ' f ' : System . out . print ( "1111" ) ; break ; default : System . out . print ( " Invalid hexadecimal digit " + hexdec[i]); } i ++ ; } } public static void main ( String args [ ] ) { String s = "1AC5" ; char hexdec [ ] = new char [ 100 ] ; hexdec = s . toCharArray ( ) ; System . out . print ( " Equivalent Binary value is : "); try { HexToBin ( hexdec ) ; } catch ( ArrayIndexOutOfBoundsException e ) { System . out . print ( " " ) ; } } }

Index/key variables: i
Accumulator variables: i
Class/struct names: Improve
Java program:
import java . io . * ; class GFG { static boolean isPowerOfTwo ( int x ) { return ( x > 0 && ( ! ( ( x & ( x - 1 ) ) > 0 ) ) ) ; } static void Count_pairs ( int a [ ] , int n ) { int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( isPowerOfTwo ( a [ i ] ) ) count ++ ; } int ans = ( count * ( count - 1 ) ) / 2 ; System . out . println ( ans ) ; } public static void main ( String [ ] args ) { int a [ ] = { 2 , 5 , 8 , 16 , 128 } ; int n = a . length ; Count_pairs ( a , n ) ; } }

Index/key variables: i
Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static int factorial ( int n ) { int result = 1 ; for ( int i = 1 ; i <= n ; i ++ ) result = result * i ; return result ; } static int nCr ( int n , int r ) { return factorial ( n ) / ( factorial ( r ) * factorial ( n - r ) ) ; } static int calculate_result ( int n ) { int result = 2 * nCr ( ( n - 2 ) , ( n / 2 - 1 ) ) ; return result ; } public static void main ( String [ ] args ) { int a = 2 , b = 4 ; System . out . println ( calculate_result ( 2 * a ) ) ; System . out . print ( calculate_result ( 2 * b ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static void PossibleValues ( int b , int x , int n ) { int leastdivisible = ( b / x + 1 ) * x ; int flag = 1 ; while ( leastdivisible <= n ) { if ( leastdivisible - b >= 1 ) { System . out . print ( leastdivisible - b + " ▁ " ) ; leastdivisible += x ; flag = 0 ; } else break ; } if ( flag > 0 ) System . out . println ( - 1 ) ; } public static void main ( String [ ] args ) { int b = 10 , x = 6 , n = 40 ; PossibleValues ( b , x , n ) ; } }

Accumulator variables: leastdivisible
Class/struct names: GFG
Java program:
import java . io . * ; import java . util . * ; public class GFG { static int digitProduct ( int [ ] digits , int start , int end ) { int pro = 1 ; for ( int i = start ; i <= end ; i ++ ) { pro *= digits [ i ] ; } return pro ; } static boolean isDistinct ( int N ) { String s = " " + N ; int len = s . length ( ) ; int [ ] digits = new int [ len ] ; ArrayList < Integer > products = new ArrayList < > ( ) ; for ( int i = 0 ; i < len ; i ++ ) { digits [ i ] = Integer . parseInt ( " " + s . charAt ( i ) ) ; } for ( int i = 0 ; i < len ; i ++ ) { for ( int j = i ; j < len ; j ++ ) { int val = digitProduct ( digits , i , j ) ; if ( products . contains ( val ) ) return false ; else products . add ( val ) ; } } return true ; } public static void main ( String args [ ] ) { int N = 324 ; if ( isDistinct ( N ) ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; } }

Index/key variables: i, len
Accumulator variables: i, j, pro
Iterator variables: i, j
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static final int MAX = 10000 ; static Vector < Integer > arr = new Vector < Integer > ( ) ; static void ulam ( ) { Set < Integer > s = new HashSet < Integer > ( ) ; arr . add ( 1 ) ; s . add ( 1 ) ; arr . add ( 2 ) ; s . add ( 2 ) ; for ( int i = 3 ; i < MAX ; i ++ ) { int count = 0 ; for ( int j = 0 ; j < arr . size ( ) ; j ++ ) { if ( s . contains ( i - arr . get ( j ) ) && arr . get ( j ) != ( i - arr . get ( j ) ) ) count ++ ; if ( count > 2 ) break ; } if ( count == 2 ) { arr . add ( i ) ; s . add ( i ) ; } } } public static void main ( String [ ] args ) { ulam ( ) ; int n = 9 ; System . out . println ( arr . get ( n - 1 ) ) ; } }

Accumulator variables: count, i, j
Iterator variables: i, j
Class/struct names: GFG
Java program:
class GFG { static long nthKyneaNumber ( int n ) { n = ( 1 << n ) + 1 ; n = n * n ; n = n - 2 ; return n ; } public static void main ( String [ ] args ) { int n = 2 ; System . out . println ( nthKyneaNumber ( n ) ) ; } }

Class/struct names: GFG
Java program:
class GFG { static long nthKyneaNumber ( int n ) { return ( ( 1 << ( 2 * n ) ) + ( 1 << ( n + 1 ) ) - 1 ) ; } public static void main ( String [ ] args ) { int n = 2 ; System . out . println ( nthKyneaNumber ( n ) ) ; } }

Class/struct names: GFG
Java program:
class GFG { static boolean isPowerOfTwo ( int n ) { return n != 0 && ( ( n & ( n - 1 ) ) == 0 ) ; } static boolean isProthNumber ( int n ) { int k = 1 ; while ( k < ( n / k ) ) { if ( n % k == 0 ) { if ( isPowerOfTwo ( n / k ) ) return true ; } k = k + 2 ; } return false ; } public static void main ( String [ ] args ) { int n = 25 ; if ( isProthNumber ( n - 1 ) ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; } }

Class/struct names: GFG
Java program:
public class AAA { static int get_last_two_digit ( long N ) { if ( N <= 10 ) { long ans = 0 , fac = 1 ; for ( int i = 1 ; i <= N ; i ++ ) { fac = fac * i ; ans += fac ; } return ( int ) ans % 100 ; } return 13 ; } public static void main ( String [ ] args ) { long N = 1 ; for ( N = 1 ; N <= 10 ; N ++ ) System . out . println ( " For ▁ N ▁ = ▁ " + N + " ▁ : ▁ " + get_last_two_digit ( N ) ) ; } }

Accumulator variables: N, ans, i
Iterator variables: N, i
Class/struct names: AAA
Java program:
public class GFG { static boolean isProductEven ( int arr [ ] , int n ) { for ( int i = 0 ; i < n ; i ++ ) if ( ( arr [ i ] & 1 ) == 0 ) return true ; return false ; } public static void main ( String args [ ] ) { int arr [ ] = { 2 , 4 , 3 , 5 } ; int n = arr . length ; if ( isProductEven ( arr , n ) ) System . out . println ( " Even " ) ; else System . out . println ( " Odd " ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
public class Improve { static int calculateSquareSum ( int n ) { if ( n <= 0 ) return 0 ; int fibo [ ] = new int [ n + 1 ] ; fibo [ 0 ] = 0 ; fibo [ 1 ] = 1 ; int sum = ( fibo [ 0 ] * fibo [ 0 ] ) + ( fibo [ 1 ] * fibo [ 1 ] ) ; for ( int i = 2 ; i <= n ; i ++ ) { fibo [ i ] = fibo [ i - 1 ] + fibo [ i - 2 ] ; sum += ( fibo [ i ] * fibo [ i ] ) ; } return sum ; } public static void main ( String args [ ] ) { int n = 6 ; System . out . println ( " Sum ▁ of ▁ squares ▁ of ▁ Fibonacci ▁ numbers ▁ is ▁ : ▁ " + calculateSquareSum ( n ) ) ; } }

Index/key variables: i
Accumulator variables: i, sum
Iterator variables: i
Class/struct names: Improve
Java program:
import java . io . * ; class GFG { static int fnMod ( int n ) { int rem = n % 4 ; if ( rem == 0 rem == 3 ) return 0 ; else if ( rem == 1 rem == 2 ) return 1 ; return 0 ; } public static void main ( String [ ] args ) { int n = 6 ; System . out . print ( fnMod ( n ) ) ; } }

Class/struct names: GFG
Java program:
import java . util . * ; import java . lang . * ; import java . io . * ; class GFG { static int MinimumMoves ( int a [ ] , int n , int x ) { int ans = 0 ; for ( int i = 1 ; i < n ; i ++ ) { if ( a [ i ] <= a [ i - 1 ] ) { int p = ( a [ i - 1 ] - a [ i ] ) / x + 1 ; ans += p ; a [ i ] += p * x ; } } return ans ; } public static void main ( String args [ ] ) { int arr [ ] = { 1 , 3 , 3 , 2 } ; int x = 2 ; int n = arr . length ; System . out . println ( MinimumMoves ( arr , n , x ) ) ; } }

Index/key variables: i
Accumulator variables: ans, i
Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { static int SumOfDigits ( String str , int n ) { int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) sum += ( int ) ( str . charAt ( i ) - '0' ) ; return sum ; } static boolean Divisible ( String str , int n ) { if ( SumOfDigits ( str , n ) % 3 == 0 && str . charAt ( n - 1 ) == '0' ) return true ; return false ; } public static void main ( String [ ] args ) { String str = "263730746028908374890" ; int n = str . length ( ) ; if ( Divisible ( str , n ) ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; } }

Accumulator variables: i, sum
Iterator variables: i
Class/struct names: GFG
Java program:
public class GFG { static boolean isPrime ( int k ) { if ( k <= 1 ) return false ; for ( int i = 2 ; i < k ; i ++ ) if ( k % i == 0 ) return false ; return true ; } static int check ( int num , int k ) { int flag = 1 ; for ( int i = 2 ; i < k ; i ++ ) { if ( num % i == 0 ) flag = 0 ; } if ( flag == 1 ) { if ( num % k == 0 ) return 1 ; else return 0 ; } else return 0 ; } static int findCount ( int a , int b , int k ) { int count = 0 ; if ( ! isPrime ( k ) ) return 0 ; else { int ans ; for ( int i = a ; i <= b ; i ++ ) { ans = check ( i , k ) ; if ( ans == 1 ) count ++ ; else continue ; } } return count ; } public static void main ( String args [ ] ) { int a = 2020 , b = 6300 , k = 29 ; System . out . println ( findCount ( a , b , k ) ) ; } }

Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static int findLargest ( int n , Vector < Integer > v ) { int flag = 0 ; long sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( v . get ( i ) == 0 ) flag = 1 ; sum += v . get ( i ) ; } if ( flag != 1 ) System . out . println ( " Not ▁ possible " ) ; else { Collections . sort ( v , Collections . reverseOrder ( ) ) ; if ( v . get ( 0 ) == 0 ) { System . out . println ( "0" ) ; return 0 ; } else { int flags = 0 ; int y = ( int ) ( sum % 3 ) ; if ( y != 0 ) { for ( int i = n - 1 ; i >= 0 ; i -- ) { if ( v . get ( i ) % 3 == y ) { v . remove ( i ) ; flags = 1 ; break ; } } if ( flags == 0 ) { y = 3 - y ; int cnt = 0 ; for ( int i = n - 1 ; i >= 0 ; i -- ) { if ( v . get ( i ) % 3 == y ) { v . remove ( i ) ; cnt ++ ; if ( cnt >= 2 ) break ; } } } } if ( v . get ( 0 ) == 0 ) System . out . println ( "0" ) ; else for ( Integer i : v ) { System . out . print ( i ) ; } } } return Integer . MIN_VALUE ; } public static void main ( String [ ] args ) { int arr [ ] = { 3 , 9 , 9 , 6 , 4 , 3 , 6 , 4 , 9 , 6 , 0 } ; int n = 11 ; Vector < Integer > v = new Vector < Integer > ( ) ; for ( int i = 0 ; i < n ; i ++ ) v . add ( i , arr [ i ] ) ; findLargest ( n , v ) ; } }

Index/key variables: i
Accumulator variables: cnt, i, sum
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static void findkth ( int n , int k ) { Vector < Integer > v1 = new Vector < Integer > ( ) ; Vector < Integer > v2 = new Vector < Integer > ( ) ; for ( int i = 1 ; i <= Math . sqrt ( n ) ; i ++ ) { if ( n % i == 0 ) { v1 . add ( i ) ; if ( i != Math . sqrt ( n ) ) v2 . add ( n / i ) ; } } Collections . reverse ( v2 ) ; if ( k > ( v1 . size ( ) + v2 . size ( ) ) ) System . out . print ( " Doesn ' t ▁ Exist " ) ; else { if ( k <= v1 . size ( ) ) System . out . print ( v1 . get ( k - 1 ) ) ; else System . out . print ( v2 . get ( k - v1 . size ( ) - 1 ) ) ; } } public static void main ( String [ ] args ) { int n = 15 , k = 2 ; findkth ( n , k ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static int NumberOfSolutions ( int a , int b , int c , int d ) { int ans = 0 ; for ( int i = a ; i <= b ; i ++ ) if ( d >= Math . max ( c , i + 1 ) ) ans += d - Math . max ( c , i + 1 ) + 1 ; return ans ; } public static void main ( String [ ] args ) { int a = 2 , b = 3 , c = 3 , d = 4 ; System . out . println ( NumberOfSolutions ( a , b , c , d ) ) ; } }

Accumulator variables: ans, i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static long findF_N ( long n ) { long ans = 0 ; for ( long i = 0 ; i < n ; ++ i ) ans += ( i + 1 ) * ( n - i - 1 ) ; return ans ; } public static void main ( String [ ] args ) { long n = 3 ; System . out . println ( findF_N ( n ) ) ; } }

Accumulator variables: ans
Iterator variables: i
Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static String findNumber ( int n , int d ) { String ans = " " ; if ( d != 10 ) { ans += Integer . toString ( d ) ; for ( int i = 1 ; i < n ; i ++ ) ans += '0' ; } else { if ( n == 1 ) ans += " Impossible " ; else { ans += '1' ; for ( int i = 1 ; i < n ; i ++ ) ans += '0' ; } } return ans ; } public static void main ( String [ ] args ) { int n = 12 , d = 3 ; System . out . println ( findNumber ( n , d ) ) ; } }

Accumulator variables: ans, i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static int MAX = 1000000 ; static int sieve_Prime [ ] = new int [ MAX + 4 ] ; static int sieve_count [ ] = new int [ MAX + 4 ] ; static void form_sieve ( ) { sieve_Prime [ 1 ] = 1 ; for ( int i = 2 ; i <= MAX ; i ++ ) { if ( sieve_Prime [ i ] == 0 ) { for ( int j = i * 2 ; j <= MAX ; j += i ) { if ( sieve_Prime [ j ] == 0 ) { sieve_Prime [ j ] = 1 ; sieve_count [ i ] ++ ; } } } } } public static void main ( String [ ] args ) { form_sieve ( ) ; int n = 2 ; System . out . println ( " Count ▁ = ▁ " + ( sieve_count [ n ] + 1 ) ) ; n = 3 ; System . out . println ( " Count ▁ = ▁ " + ( sieve_count [ n ] + 1 ) ) ; } }

Index/key variables: i, j, n
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
Java program:
import java . io . * ; class GFG { public static void main ( String [ ] args ) { int matrix [ ] [ ] = new int [ 5 ] [ 5 ] , row_index , column_index , x = 0 , size = 5 ; for ( row_index = 0 ; row_index < size ; row_index ++ ) { for ( column_index = 0 ; column_index < size ; column_index ++ ) { matrix [ row_index ] [ column_index ] = ++ x ; } } System . out . printf ( "The matrix isNEW_LINE"); for ( row_index = 0 ; row_index < size ; row_index ++ ) { for ( column_index = 0 ; column_index < size ; column_index ++ ) { System . out . printf ( " % d TABSYMBOL " , matrix [ row_index ] [ column_index ] ) ; } System . out . printf ( "NEW_LINE"); } System . out . printf ( " Elements on Secondary diagonal : "); for ( row_index = 0 ; row_index < size ; row_index ++ ) { for ( column_index = 0 ; column_index < size ; column_index ++ ) { if ( ( row_index + column_index ) == size - 1 ) System . out . printf ( " % d , ▁ " , matrix [ row_index ] [ column_index ] ) ; } } } }

Index/key variables: column_index, row_index
Accumulator variables: column_index, row_index
Iterator variables: column_index, row_index
Class/struct names: GFG
Java program:
class GFG { public static void main ( String [ ] args ) { int [ ] [ ] matrix = new int [ 5 ] [ 5 ] ; int row_index , column_index , x = 0 , size = 5 ; for ( row_index = 0 ; row_index < size ; row_index ++ ) { for ( column_index = 0 ; column_index < size ; column_index ++ ) { matrix [ row_index ] [ column_index ] = ++ x ; } } System . out . printf ( "The matrix isNEW_LINE"); for ( row_index = 0 ; row_index < size ; row_index ++ ) { for ( column_index = 0 ; column_index < size ; column_index ++ ) { System . out . printf ( " % d TABSYMBOL " , matrix [ row_index ] [ column_index ] ) ; } System . out . printf ( "NEW_LINE"); } System . out . printf ( " Elements above Secondary " ▁ + ▁ " diagonal are : "); for ( row_index = 0 ; row_index < size ; row_index ++ ) { for ( column_index = 0 ; column_index < size ; column_index ++ ) { if ( ( row_index + column_index ) < size - 1 ) System . out . printf ( " % d , ▁ " , matrix [ row_index ] [ column_index ] ) ; } } } }

Index/key variables: column_index, row_index
Accumulator variables: column_index, row_index
Iterator variables: column_index, row_index
Class/struct names: GFG
Java program:
class GFG { public static void main ( String [ ] args ) { int [ ] [ ] matrix = new int [ 5 ] [ 5 ] ; int row_index , column_index , x = 0 , size = 5 ; for ( row_index = 0 ; row_index < size ; row_index ++ ) { for ( column_index = 0 ; column_index < size ; column_index ++ ) { matrix [ row_index ] [ column_index ] = ++ x ; } } System . out . printf ( "The matrix isNEW_LINE"); for ( row_index = 0 ; row_index < size ; row_index ++ ) { for ( column_index = 0 ; column_index < size ; column_index ++ ) { System . out . printf ( " % d TABSYMBOL " , matrix [ row_index ] [ column_index ] ) ; } System . out . printf ( "NEW_LINE"); } System . out . printf ( " Corner Elements are : "); for ( row_index = 0 ; row_index < size ; row_index ++ ) { for ( column_index = 0 ; column_index < size ; column_index ++ ) { if ( ( row_index == 0 row_index == size - 1 ) && ( column_index == 0 column_index == size - 1 ) ) System . out . printf ( " % d , ▁ " , matrix [ row_index ] [ column_index ] ) ; } } } }

Index/key variables: column_index, row_index
Accumulator variables: column_index, row_index
Iterator variables: column_index, row_index
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static Vector < Integer > PrimeFactors ( int n ) { Vector < Integer > v = new Vector < Integer > ( ) ; int x = n ; for ( int i = 2 ; i * i <= n ; i ++ ) { if ( x % i == 0 ) { v . add ( i ) ; while ( x % i == 0 ) x /= i ; } } if ( x > 1 ) v . add ( x ) ; return v ; } static int GoodNumber ( int n ) { Vector < Integer > v = new Vector < Integer > ( PrimeFactors ( n ) ) ; int ans = 1 ; for ( int i = 0 ; i < v . size ( ) ; i ++ ) ans *= v . get ( i ) ; return ans ; } public static void main ( String [ ] args ) { int n = 12 ; System . out . println ( GoodNumber ( n ) ) ; } }

Accumulator variables: ans, i, x
Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { static boolean checkSpecialPrime ( boolean [ ] sieve , int num ) { while ( num != 0 ) { if ( ! sieve [ num ] ) { return false ; } num /= 10 ; } return true ; } static void findSpecialPrime ( int N ) { boolean [ ] sieve = new boolean [ N + 10 ] ; sieve [ 0 ] = sieve [ 1 ] = false ; for ( int i = 0 ; i < N + 10 ; i ++ ) sieve [ i ] = true ; for ( int i = 2 ; i <= N ; i ++ ) { if ( sieve [ i ] ) { for ( int j = i * i ; j <= N ; j += i ) { sieve [ j ] = false ; } } } while ( true ) { if ( checkSpecialPrime ( sieve , N ) ) { System . out . println ( N ) ; break ; } else N -- ; } } public static void main ( String [ ] args ) { findSpecialPrime ( 379 ) ; findSpecialPrime ( 100 ) ; } }

Index/key variables: i, j, num
Accumulator variables: N, i, j, num
Iterator variables: i, j
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static final int MAX = 1000000 ; static Vector < Integer > arr = new Vector < > ( ) ; static boolean [ ] sprime = new boolean [ MAX ] ; static void computeSemiPrime ( ) { for ( int i = 0 ; i < MAX ; i ++ ) sprime [ i ] = false ; for ( int i = 2 ; i < MAX ; i ++ ) { int cnt = 0 ; int num = i ; for ( int j = 2 ; cnt < 2 && j * j <= num ; ++ j ) { while ( num % j == 0 ) { num /= j ; ++ cnt ; } } if ( num > 1 ) ++ cnt ; if ( cnt == 2 ) { sprime [ i ] = true ; arr . add ( i ) ; } } } static boolean checkSemiPrime ( int n ) { int i = 0 ; while ( arr . get ( i ) <= n / 2 ) { if ( sprime [ n - arr . get ( i ) ] ) { return true ; } i ++ ; } return false ; } public static void main ( String [ ] args ) { computeSemiPrime ( ) ; int n = 30 ; if ( checkSemiPrime ( n ) ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; } }

Index/key variables: MAX, i
Accumulator variables: i, num
Iterator variables: i, j
Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static float heightCalculate ( int H , int n , int m ) { float N = ( float ) ( n * 1.0 ) ; float M = ( float ) ( m * 1.0 ) ; float h = H * ( float ) Math . sqrt ( N / ( N + M ) ) ; return h ; } public static void main ( String [ ] args ) { int H = 10 , n = 3 , m = 4 ; System . out . print ( heightCalculate ( H , n , m ) ) ; } }

Class/struct names: GFG
Java program:
class GFG { static boolean isprime ( int x ) { for ( int i = 2 ; i * i <= x ; i ++ ) if ( x % i == 0 ) return false ; return true ; } static boolean isNSqMinusnMSqPrime ( int m , int n ) { if ( n - m == 1 && isprime ( m + n ) ) return true ; else return false ; } public static void main ( String [ ] args ) { int m = 13 , n = 16 ; if ( isNSqMinusnMSqPrime ( m , n ) ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG