dhyuti-n/xlcost-variable-roles huggingface dataset:
Java program:
class GFG { static int binomialCoeff ( int n , int k ) { int [ ] [ ] C = new int [ n + 1 ] [ k + 1 ] ; int i , j ; for ( i = 0 ; i <= n ; i ++ ) { for ( j = 0 ; j <= Math . min ( i , k ) ; j ++ ) { if ( j == 0 j == i ) C [ i ] [ j ] = 1 ; else C [ i ] [ j ] = C [ i - 1 ] [ j - 1 ] + C [ i - 1 ] [ j ] ; } } return C [ n ] [ k ] ; } static int findMax ( int n ) { return binomialCoeff ( n , n / 2 ) ; } public static void main ( String [ ] args ) { int n = 5 ; System . out . println ( findMax ( n ) ) ; } }

Index/key variables: i, j, k, n
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
Java program:
import java . math . * ; class GFG { public static int findGCD ( int a , int b ) { if ( b == 0 ) return a ; else return findGCD ( b , a % b ) ; } static void findNumbers ( int a , int b ) { int gcd = findGCD ( a , b ) ; System . out . println ( ( a / gcd ) + " ▁ " + ( b / gcd ) ) ; } public static void main ( String [ ] args ) { int a = 12 , b = 16 ; findNumbers ( a , b ) ; } }

Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static void findBalance ( int x , float bal ) { if ( x % 10 == 0 && ( ( float ) x + 1.50 ) <= bal ) { System . out . printf ( "%.2fNEW_LINE", bal - x - 1.50); } else { System . out . printf ( "%.2fNEW_LINE", bal); } } public static void main ( String [ ] args ) { int x = 50 ; float bal = ( float ) 100.50 ; findBalance ( x , bal ) ; } }

Class/struct names: GFG
Java program:
class GFG { static int countKdivPairs ( int A [ ] , int n , int K ) { int [ ] freq = new int [ K ] ; int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int rem = A [ i ] % K ; ans += freq [ ( K - rem ) % K ] ; freq [ rem ] ++ ; } return ans ; } public static void main ( String [ ] args ) { int A [ ] = { 2 , 2 , 1 , 7 , 5 , 3 } ; int n = A . length ; int K = 4 ; System . out . println ( countKdivPairs ( A , n , K ) ) ; } }

Index/key variables: K, i, rem
Accumulator variables: ans, i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static void min_visible_bottles ( int [ ] arr , int n ) { HashMap < Integer , Integer > mp = new HashMap < Integer , Integer > ( ) ; int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( mp . containsKey ( arr [ i ] ) ) { mp . put ( arr [ i ] , mp . get ( arr [ i ] ) + 1 ) ; } else { mp . put ( arr [ i ] , 1 ) ; } ans = Math . max ( ans , mp . get ( arr [ i ] ) ) ; } System . out . print ( " Minimum ▁ number ▁ of ▁ " + " Visible ▁ Bottles ▁ are : ▁ " + ans + "NEW_LINE"); } public static void main ( String [ ] args ) { int n = 8 ; int arr [ ] = { 1 , 1 , 2 , 3 , 4 , 5 , 5 , 4 } ; min_visible_bottles ( arr , n ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { static class Node { int data ; Node next ; } ; static Node create ( Node head , int x ) { Node temp , ptr = head ; temp = new Node ( ) ; temp . data = x ; temp . next = null ; if ( head == null ) head = temp ; else { while ( ptr . next != null ) { ptr = ptr . next ; } ptr . next = temp ; } return head ; } static Node removeNthFromEnd ( Node head , int B ) { int len = 0 ; Node tmp = head ; while ( tmp != null ) { len ++ ; tmp = tmp . next ; } if ( B > len ) { System . out . print ( " Length ▁ of ▁ the ▁ linked ▁ list ▁ is ▁ " + len ) ; System . out . print ( " ▁ we ▁ can ' t ▁ remove ▁ " + B + " th ▁ node ▁ from ▁ the " ) ; System . out . print ( " linked listNEW_LINE"); return head ; } else if ( B == len ) { return head . next ; } else { int diff = len - B ; Node prev = null ; Node curr = head ; for ( int i = 0 ; i < diff ; i ++ ) { prev = curr ; curr = curr . next ; } prev . next = curr . next ; return head ; } } static void display ( Node head ) { Node temp = head ; while ( temp != null ) { System . out . print ( temp . data + " ▁ " ) ; temp = temp . next ; } System . out . println ( ) ; } public static void main ( String [ ] args ) { Node head = null ; head = create ( head , 1 ) ; head = create ( head , 2 ) ; head = create ( head , 3 ) ; head = create ( head , 4 ) ; head = create ( head , 5 ) ; int n = 2 ; System . out . print ( "Linked list before modification: NEW_LINE"); display ( head ) ; head = removeNthFromEnd ( head , 2 ) ; System . out . print ( "Linked list after modification: NEW_LINE"); display ( head ) ; } }

Accumulator variables: i, len
Iterator variables: i
Class/struct names: GFG, Node
Java program:
import java . io . * ; class GFG { static void solveEven ( int n , int arr [ ] , int b [ ] ) { int left = n - 1 ; for ( int i = 0 ; i < ( n / 2 ) ; ++ i ) { b [ i ] = arr [ left ] ; left = left - 2 ; if ( left < 0 ) break ; } int right = 0 ; for ( int i = n / 2 ; i <= n - 1 ; ++ i ) { b [ i ] = arr [ right ] ; right = right + 2 ; if ( right > n - 2 ) break ; } } static void solveOdd ( int n , int arr [ ] , int b [ ] ) { int left = n - 1 ; for ( int i = 0 ; i < ( n / 2 ) + 1 ; ++ i ) { b [ i ] = arr [ left ] ; left = left - 2 ; if ( left < 0 ) break ; } int right = 1 ; for ( int i = ( n / 2 ) + 1 ; i <= n - 1 ; ++ i ) { b [ i ] = arr [ right ] ; right = right + 2 ; if ( right > n - 2 ) break ; } } static void solve ( int n , int arr [ ] ) { int b [ ] = new int [ n ] ; if ( n % 2 == 0 ) solveEven ( n , arr , b ) ; else solveOdd ( n , arr , b ) ; for ( int i = 0 ; i <= n - 1 ; ++ i ) { System . out . print ( b [ i ] + " ▁ " ) ; } } public static void main ( String [ ] args ) { int [ ] arr = { 1 , 2 , 3 , 4 } ; int n = arr . length ; solve ( n , arr ) ; } }

Index/key variables: i, left, n, right
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { public static void sum_of_elements ( int [ ] arr , int n ) { int sumfirst = 0 , sumsecond = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( i < n / 2 ) { sumfirst += arr [ i ] ; } else { sumsecond += arr [ i ] ; } } System . out . println ( " Sum ▁ of ▁ first ▁ half ▁ elements ▁ is ▁ " + sumfirst ) ; System . out . println ( " Sum ▁ of ▁ second ▁ half ▁ elements ▁ is ▁ " + sumsecond ) ; } public static void main ( String [ ] args ) { int [ ] arr = { 20 , 30 , 60 , 10 , 25 , 15 , 40 } ; int n = arr . length ; sum_of_elements ( arr , n ) ; } }

Index/key variables: i
Accumulator variables: i, sumfirst, sumsecond
Iterator variables: i
Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static int minimum_sum ( int n , int k ) { if ( k % n == 0 ) return 0 ; return 1 ; } public static void main ( String [ ] args ) { int n = 3 , k = 56 ; System . out . println ( minimum_sum ( n , k ) ) ; } }

Class/struct names: GFG
Java program:
class GFG { static void lowerWythoff ( int n ) { double phi = ( 1 + Math . sqrt ( 5 ) ) / 2.0 ; for ( int i = 1 ; i <= n ; i ++ ) { double ans = Math . floor ( i * phi ) ; System . out . print ( ( int ) ans ) ; if ( i != n ) System . out . print ( " ▁ , ▁ " ) ; } } public static void main ( String [ ] args ) { int n = 5 ; lowerWythoff ( n ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static class Node { int data ; Node next ; } ; static Node insert ( Node root , int item ) { Node ptr , temp ; temp = new Node ( ) ; temp . data = item ; temp . next = null ; if ( root == null ) root = temp ; else { ptr = root ; while ( ptr . next != null ) ptr = ptr . next ; ptr . next = temp ; } return root ; } static Node newList ( Node root1 , Node root2 ) { Node ptr1 = root1 , ptr2 = root2 , ptr ; Node root = null , temp ; while ( ptr1 != null ) { temp = new Node ( ) ; temp . next = null ; if ( ptr1 . data < ptr2 . data ) temp . data = ptr2 . data ; else temp . data = ptr1 . data ; if ( root == null ) root = temp ; else { ptr = root ; while ( ptr . next != null ) ptr = ptr . next ; ptr . next = temp ; } ptr1 = ptr1 . next ; ptr2 = ptr2 . next ; } return root ; } static void display ( Node root ) { while ( root != null ) { System . out . print ( root . data + " - > " ) ; root = root . next ; } System . out . println ( ) ; } public static void main ( String args [ ] ) { Node root1 = null , root2 = null , root = null ; root1 = insert ( root1 , 5 ) ; root1 = insert ( root1 , 2 ) ; root1 = insert ( root1 , 3 ) ; root1 = insert ( root1 , 8 ) ; System . out . print ( " First ▁ List : ▁ " ) ; display ( root1 ) ; root2 = insert ( root2 , 1 ) ; root2 = insert ( root2 , 7 ) ; root2 = insert ( root2 , 4 ) ; root2 = insert ( root2 , 5 ) ; System . out . print ( " Second ▁ List : ▁ " ) ; display ( root2 ) ; root = newList ( root1 , root2 ) ; System . out . print ( " New ▁ List : ▁ " ) ; display ( root ) ; } }

Class/struct names: GFG, Node
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 countQuadruplets ( int l , int r , int k ) { int count = 0 ; for ( int u = l ; u <= r ; u ++ ) { for ( int v = l ; v <= r ; v ++ ) { for ( int w = l ; w <= r ; w ++ ) { for ( int x = l ; x <= r ; x ++ ) { if ( gcd ( gcd ( u , v ) , gcd ( w , x ) ) == k ) count ++ ; } } } } return count ; } public static void main ( String [ ] args ) { int l = 1 , r = 10 , k = 2 ; System . out . println ( countQuadruplets ( l , r , k ) ) ; } }

Accumulator variables: count, u, v, w, x
Iterator variables: u, v, w, x
Class/struct names: GFG
Java program:
class GFG { static int findIndex ( int a [ ] , int n ) { int res = 0 ; long min_diff = Long . MAX_VALUE ; long prod [ ] = new long [ n ] ; prod [ 0 ] = a [ 0 ] ; for ( int i = 1 ; i < n ; i ++ ) prod [ i ] = prod [ i - 1 ] * a [ i ] ; for ( int i = 0 ; i < n - 1 ; i ++ ) { long curr_diff = Math . abs ( ( prod [ n - 1 ] / prod [ i ] ) - prod [ i ] ) ; if ( curr_diff < min_diff ) { min_diff = curr_diff ; res = i ; } } return res ; } public static void main ( String arg [ ] ) { int arr [ ] = { 3 , 2 , 5 , 7 , 2 , 9 } ; int N = arr . length ; System . out . println ( findIndex ( arr , N ) ) ; } }

Index/key variables: i, n
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { static void printNumbers ( int a [ ] , int n , int x ) { boolean flag = false ; for ( int i = 0 ; i < n ; i ++ ) { int num = a [ i ] ; int g = __gcd ( num , x ) ; while ( g != 1 ) { num /= g ; g = __gcd ( num , x ) ; } if ( num == 1 ) { flag = true ; System . out . print ( a [ i ] + " ▁ " ) ; } } if ( ! flag ) System . out . println ( " There ▁ are ▁ no ▁ such ▁ numbers " ) ; } static int __gcd ( int a , int b ) { if ( b == 0 ) return a ; return __gcd ( b , a % b ) ; } public static void main ( String [ ] args ) { int x = 60 ; int a [ ] = { 2 , 5 , 10 , 7 , 17 } ; int n = a . length ; printNumbers ( a , n , x ) ; } }

Index/key variables: i
Accumulator variables: i, num
Iterator variables: i
Boolean variables: flag
Class/struct names: GFG
Java program:
class GFG { static void print ( int rStation [ ] , int n ) { for ( int i = 1 ; i <= n ; i ++ ) System . out . print ( rStation [ i ] + " ▁ " ) ; System . out . println ( " " ) ; } static void radiated_Station ( int station [ ] , int n ) { int rStation [ ] = new int [ n + 1 ] ; for ( int i = 1 ; i <= n ; i ++ ) { int li = i - 1 , ri = i + 1 ; int lRad = station [ i ] - 1 , rRad = station [ i ] - 1 ; rStation [ i ] += station [ i ] ; while ( li >= 1 && lRad >= 1 ) { rStation [ li -- ] += lRad -- ; } while ( ri <= n && rRad >= 1 ) { rStation [ ri ++ ] += rRad -- ; } } print ( rStation , n ) ; } public static void main ( String [ ] args ) { int station [ ] = { 0 , 7 , 9 , 12 , 2 , 5 } ; int n = station . length - 1 ; radiated_Station ( station , n ) ; } }

Index/key variables: i
Accumulator variables: i, lRad, li, rRad, ri
Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { static int findMaximumDiff ( int [ ] a , int n ) { int ind1 = 0 ; for ( int i = n - 1 ; i > 0 ; i -- ) { if ( a [ 0 ] != a [ i ] ) { ind1 = i ; break ; } } int ind2 = 0 ; for ( int i = 0 ; i < n - 1 ; i ++ ) { if ( a [ n - 1 ] != a [ i ] ) { ind2 = ( n - 1 - i ) ; break ; } } return Math . max ( ind1 , ind2 ) ; } public static void main ( String args [ ] ) { int [ ] a = { 1 , 2 , 3 , 2 , 3 } ; int n = a . length ; System . out . println ( findMaximumDiff ( a , n ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static int N = 100005 ; static int n ; static ArrayList < ArrayList < Integer > > tree = new ArrayList < > ( ) ; static int currentIdx ; static int [ ] startIdx ; static int [ ] endIdx ; static int [ ] p ; static void Add_edge ( int u , int v ) { tree . get ( u ) . add ( v ) ; tree . get ( v ) . add ( u ) ; } static void intisalise ( ) { startIdx = new int [ n + 1 ] ; endIdx = new int [ n + 1 ] ; p = new int [ n + 1 ] ; } static void Dfs ( int ch , int par ) { p [ currentIdx ] = ch ; startIdx [ ch ] = currentIdx ++ ; for ( int c : tree . get ( ch ) ) { if ( c != par ) Dfs ( c , ch ) ; } endIdx [ ch ] = currentIdx - 1 ; } static int findNode ( int v , int k ) { k += startIdx [ v ] - 1 ; if ( k <= endIdx [ v ] ) return p [ k ] ; return - 1 ; } public static void main ( String [ ] args ) { n = 9 ; for ( int i = 0 ; i <= n ; i ++ ) tree . add ( new ArrayList < Integer > ( ) ) ; Add_edge ( 1 , 2 ) ; Add_edge ( 1 , 3 ) ; Add_edge ( 1 , 4 ) ; Add_edge ( 3 , 5 ) ; Add_edge ( 3 , 7 ) ; Add_edge ( 5 , 6 ) ; Add_edge ( 5 , 8 ) ; Add_edge ( 7 , 9 ) ; intisalise ( ) ; Dfs ( 1 , 0 ) ; int v = 3 , k = 4 ; System . out . println ( findNode ( v , k ) ) ; } }

Index/key variables: ch, currentIdx, k, v
Accumulator variables: currentIdx, i, k
Iterator variables: c, i
Class/struct names: GFG
Java program:
class GFG { static int sum ( int k , int n ) { int sum = ( int ) ( Math . pow ( k , n + 1 ) - Math . pow ( k - 1 , n + 1 ) ) ; return sum ; } public static void main ( String args [ ] ) { int n = 3 ; int K = 3 ; System . out . print ( sum ( K , n ) ) ; } }

Class/struct names: GFG
Java program:
class GfG { static boolean is_prime ( int num ) { int count = 0 ; for ( int i = 1 ; i * i <= ( num ) ; i ++ ) { if ( ( num ) % i == 0 ) { if ( i * i != ( num ) ) count += 2 ; else count ++ ; } } if ( count == 2 ) return true ; else return false ; } static String is_divisible ( int n ) { if ( n == 1 ) { return " YES " ; } else { if ( is_prime ( n + 1 ) ) return " NO " ; else return " YES " ; } } public static void main ( String [ ] args ) { int n ; n = 3 ; System . out . println ( is_divisible ( n ) ) ; n = 4 ; System . out . println ( is_divisible ( n ) ) ; } }

Accumulator variables: count, i
Iterator variables: i
Class/struct names: GfG
Java program:
import java . util . * ; class GFG { static final int MAX = 100005 ; static long [ ] partial_sum ( long [ ] prefix_sum , int [ ] arr , int n ) { for ( int i = 1 ; i <= n ; i ++ ) { prefix_sum [ i ] = ( prefix_sum [ i - 1 ] + arr [ i - 1 ] ) ; } return prefix_sum ; } static int countSubarrays ( int [ ] arr , int n , int k ) { long [ ] prefix_sum = new long [ MAX ] ; prefix_sum [ 0 ] = 0 ; prefix_sum = partial_sum ( prefix_sum , arr , n ) ; int sum ; if ( k == 1 ) { sum = 0 ; HashMap < Long , Integer > m = new HashMap < > ( ) ; for ( int i = n ; i >= 0 ; i -- ) { if ( m . containsKey ( prefix_sum [ i ] + 1 ) ) sum += m . get ( prefix_sum [ i ] + 1 ) ; if ( m . containsKey ( prefix_sum [ i ] ) ) m . put ( prefix_sum [ i ] , m . get ( prefix_sum [ i ] ) + 1 ) ; else m . put ( prefix_sum [ i ] , 1 ) ; } return sum ; } if ( k == - 1 ) { sum = 0 ; HashMap < Long , Integer > m = new HashMap < > ( ) ; for ( int i = n ; i >= 0 ; i -- ) { if ( m . containsKey ( prefix_sum [ i ] + 1 ) ) sum += m . get ( prefix_sum [ i ] + 1 ) ; if ( m . containsKey ( prefix_sum [ i ] - 1 ) ) sum += m . get ( prefix_sum [ i ] - 1 ) ; if ( m . containsKey ( prefix_sum [ i ] ) ) m . put ( prefix_sum [ i ] , m . get ( prefix_sum [ i ] ) + 1 ) ; else m . put ( prefix_sum [ i ] , 1 ) ; } return sum ; } sum = 0 ; long b , l = 100000000000000L ; HashMap < Long , Integer > m = new HashMap < > ( ) ; for ( int i = n ; i >= 0 ; i -- ) { b = 1 ; while ( true ) { if ( b > l ) break ; if ( m . containsKey ( prefix_sum [ i ] + b ) ) sum += m . get ( prefix_sum [ i ] + b ) ; b *= k ; } if ( m . containsKey ( prefix_sum [ i ] ) ) m . put ( ( prefix_sum [ i ] ) , m . get ( prefix_sum [ i ] ) + 1 ) ; else m . put ( ( prefix_sum [ i ] ) , 1 ) ; } return sum ; } public static void main ( String [ ] args ) { int arr [ ] = { 2 , 2 , 2 , 2 } ; int n = arr . length ; int k = 2 ; System . out . print ( countSubarrays ( arr , n , k ) ) ; } }

Index/key variables: MAX, i
Accumulator variables: b, i, sum
Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { static int mod = ( int ) ( 1e9 + 7 ) ; static int BitOperations ( String a , int n , String b , int m ) { char [ ] ch1 = a . toCharArray ( ) ; reverse ( ch1 ) ; a = new String ( ch1 ) ; char [ ] ch2 = b . toCharArray ( ) ; reverse ( ch2 ) ; b = new String ( ch2 ) ; int c = 0 ; for ( int i = 0 ; i < m ; i ++ ) if ( b . charAt ( i ) == '1' ) c ++ ; int [ ] power = new int [ n ] ; power [ 0 ] = 1 ; for ( int i = 1 ; i < n ; i ++ ) power [ i ] = ( power [ i - 1 ] * 2 ) % mod ; int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( a . charAt ( i ) == '1' ) { ans += c * power [ i ] ; if ( ans >= mod ) ans %= mod ; } if ( b . charAt ( i ) == '1' ) c -- ; if ( c == 0 ) break ; } return ans ; } static void reverse ( char a [ ] ) { int i , k , n = a . length ; char t ; for ( i = 0 ; i < n / 2 ; i ++ ) { t = a [ i ] ; a [ i ] = a [ n - i - 1 ] ; a [ n - i - 1 ] = t ; } } public static void main ( String [ ] args ) { String a = "1001" , b = "10101" ; int n = a . length ( ) , m = b . length ( ) ; System . out . println ( BitOperations ( a , n , b , m ) ) ; } }

Index/key variables: i, n
Accumulator variables: ans, c, i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . Arrays ; class GFG { static void sieve ( int maxEle , int prime [ ] ) { prime [ 0 ] = prime [ 1 ] = 1 ; for ( int i = 2 ; i * i <= maxEle ; i ++ ) { if ( prime [ i ] == 0 ) { for ( int j = 2 * i ; j <= maxEle ; j += i ) prime [ j ] = 1 ; } } } static int digitSum ( int n ) { int sum = 0 ; while ( n > 0 ) { sum += n % 10 ; n = n / 10 ; } return sum ; } static void printAdditivePrime ( int arr [ ] , int n ) { int maxEle = Arrays . stream ( arr ) . max ( ) . getAsInt ( ) ; int prime [ ] = new int [ maxEle + 1 ] ; sieve ( maxEle , prime ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( prime [ arr [ i ] ] == 0 ) { int sum = digitSum ( arr [ i ] ) ; if ( prime [ sum ] == 0 ) System . out . print ( arr [ i ] + " ▁ " ) ; } } } public static void main ( String [ ] args ) { int a [ ] = { 2 , 4 , 6 , 11 , 12 , 18 , 7 } ; int n = a . length ; printAdditivePrime ( a , n ) ; } }

Index/key variables: i, j, sum
Accumulator variables: i, j, sum
Iterator variables: i, j
Class/struct names: GFG
Java program:
class GFG { static long nthTerm ( long n ) { long nth ; if ( n % 2 == 0 ) nth = 2 * ( ( n * n ) - n ) ; else nth = ( 2 * n * n ) - n ; return nth ; } public static void main ( String [ ] args ) { long n ; n = 5 ; System . out . println ( nthTerm ( n ) ) ; n = 25 ; System . out . println ( nthTerm ( n ) ) ; n = 25000000 ; System . out . println ( nthTerm ( n ) ) ; n = 250000007 ; System . out . println ( nthTerm ( n ) ) ; } }

Class/struct names: GFG
Java program:
import java . util . * ; import java . lang . * ; import java . io . * ; public class GFG { static int nthTerm ( int n ) { int An = ( ( int ) Math . pow ( 1 , n ) + ( int ) Math . pow ( 2 , n ) ) * ( int ) Math . pow ( 3 , n ) ; return An ; } public static void main ( String [ ] args ) { int n = 3 ; System . out . println ( nthTerm ( n ) ) ; } }

Class/struct names: GFG
Java program:
public class GFG { static int countDivisors ( int n ) { int x = 0 , ans = 1 ; while ( n % 2 == 0 ) { x ++ ; n = n / 2 ; } ans = ans * ( x + 1 ) ; for ( int i = 3 ; i <= Math . sqrt ( n ) ; i = i + 2 ) { x = 0 ; while ( n % i == 0 ) { x ++ ; n = n / i ; } ans = ans * ( x + 1 ) ; } if ( n > 2 ) ans = ans * 2 ; return ans ; } static int getTotalCount ( int n , int k ) { int k_count = countDivisors ( k ) ; int count = 0 ; for ( int i = 1 ; i < n ; i ++ ) if ( k_count == countDivisors ( i ) ) count ++ ; if ( k < n ) count = count - 1 ; return count ; } public static void main ( String [ ] args ) { int n = 500 , k = 6 ; System . out . println ( getTotalCount ( n , k ) ) ; } }

Accumulator variables: count, i, x
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; import java . lang . * ; import java . io . * ; public class GFG { static int nthTerm ( int n ) { int d = 2 ; int a1 = 0 ; int An = a1 + ( n - 1 ) * d ; return ( int ) Math . pow ( An , 3 ) ; } public static void main ( String [ ] args ) { int n = 5 ; System . out . println ( nthTerm ( n ) ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; import java . util . * ; import java . lang . * ; class GFG { static final int MAX_VAL = 200000 ; static int countIntervals ( int [ ] [ ] arr , int V , int N ) { int min = Integer . MAX_VALUE , max = Integer . MIN_VALUE ; int li , ri ; int [ ] freq = new int [ MAX_VAL ] ; for ( int i = 0 ; i < N ; i ++ ) { li = arr [ i ] [ 0 ] ; freq [ li ] = freq [ li ] + 1 ; ri = arr [ i ] [ 1 ] ; freq [ ri + 1 ] = freq [ ri + 1 ] - 1 ; if ( li < min ) min = li ; if ( ri > max ) max = ri ; } for ( int i = min ; i <= max ; i ++ ) freq [ i ] = freq [ i ] + freq [ i - 1 ] ; return freq [ V ] ; } public static void main ( String args [ ] ) { int [ ] [ ] arr = { { 1 , 10 } , { 5 , 10 } , { 15 , 25 } , { 7 , 12 } , { 20 , 25 } } ; int V = 7 ; int N = arr . length ; System . out . println ( countIntervals ( arr , V , N ) ) ; } }

Index/key variables: MAX_VAL, V, i, li
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static void printGroups ( int n ) { int x = 1 ; int y = n * n ; for ( int i = 1 ; i <= n ; i ++ ) { for ( int j = 1 ; j <= n / 2 ; j ++ ) { System . out . print ( " { ▁ " + x + " , ▁ " + y + " } ▁ " ) ; x ++ ; y -- ; } System . out . println ( ) ; } } public static void main ( String [ ] args ) { int n = 4 ; printGroups ( n ) ; } }

Accumulator variables: i, j, x, y
Iterator variables: i, j
Class/struct names: GFG
Java program:
import java . io . * ; import java . lang . * ; class GFG { public static int breakEvenPoint ( int exp1 , int S , int M ) { double earn = S - M ; double exp = exp1 ; double res = Math . ceil ( exp / earn ) ; int res1 = ( int ) res ; return res1 ; } public static void main ( String [ ] args ) { int exp = 3550 , S = 90 , M = 65 ; System . out . println ( breakEvenPoint ( exp , S , M ) ) ; } }

Class/struct names: GFG
Java program:
import java . util . * ; class solution { static int minimum ( int n ) { int product = 1 ; for ( int i = 2 ; i * i <= n ; i ++ ) { if ( n % i == 0 ) { while ( n % i == 0 ) n = n / i ; product = product * i ; } } if ( n >= 2 ) product = product * n ; return product ; } public static void main ( String arr [ ] ) { int n = 20 ; System . out . println ( minimum ( n ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: solution
Java program:
class GFG { static int numbers ( int n , int arr [ ] , int m ) { int isZero = 0 , isFive = 0 ; int result = 0 ; if ( m < n ) { return - 1 ; } for ( int i = 0 ; i < m ; i ++ ) { if ( arr [ i ] == 0 ) { isZero = 1 ; } if ( arr [ i ] == 5 ) { isFive = 1 ; } } if ( isZero == 1 && isFive == 1 ) { result = 2 ; for ( int i = 0 ; i < n - 1 ; i ++ ) { result = result * ( -- m ) ; } } else if ( isZero == 1 isFive == 1 ) { result = 1 ; for ( int i = 0 ; i < n - 1 ; i ++ ) { result = result * ( -- m ) ; } } else { result = - 1 ; } return result ; } public static void main ( String [ ] args ) { int n = 3 , m = 6 ; int arr [ ] = { 2 , 3 , 5 , 6 , 7 , 9 } ; System . out . println ( numbers ( n , arr , m ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . io . * ; class GFG { public static void main ( String [ ] args ) { int a = 5 , b = 7 , c = 10 ; if ( a <= b && a <= c ) System . out . println ( a + " ▁ is ▁ the ▁ smallest " ) ; else if ( b <= a && b <= c ) System . out . println ( b + " ▁ is ▁ the ▁ smallest " ) ; else System . out . println ( c + " ▁ is ▁ the ▁ smallest " ) ; } }

Class/struct names: GFG