dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; using System . Collections . Generic ; class GFG { static int MAX = 1000000 ; static List < int > addPrimes ( ) { int n = MAX ; Boolean [ ] prime = new Boolean [ n + 1 ] ; for ( int i = 0 ; i < n + 1 ; i ++ ) prime [ i ] = 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 ; } } List < int > ans = new List < int > ( ) ; for ( int p = 2 ; p <= n ; p ++ ) if ( prime [ p ] ) ans . Add ( p ) ; return ans ; } static int pi ( int x , List < int > v ) { int l = 0 , r = v . Count - 1 , m , i = - 1 ; while ( l <= r ) { m = ( l + r ) / 2 ; if ( v [ m ] <= x ) { i = m ; l = m + 1 ; } else { r = m - 1 ; } } return i + 1 ; } static int Ramanujan ( int n , List < int > 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 ; List < int > v = addPrimes ( ) ; for ( int i = 1 ; i <= n ; i ++ ) { Console . Write ( Ramanujan ( i , v ) ) ; if ( i != n ) Console . Write ( " , ▁ " ) ; } } public static void Main ( String [ ] args ) { int n = 10 ; Ramanujan_Numbers ( n ) ; } }

Index/key variables: i, m, p
Accumulator variables: i, p
Iterator variables: i, p
Class/struct names: GFG
C# program:
using System ; 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 ) { int [ ] arr = { 1 , 0 , 2 , 3 , 7 } ; int n = arr . Length ; if ( validQuadruple ( arr , n ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Index/key variables: i, j, k, l
Accumulator variables: i, j, k, l
Iterator variables: i, j, k, l
Class/struct names: GFG
C# program:
using System ; 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 ) { int X = 2 , Y = 2 , M = 3 , N = 3 ; Console . WriteLine ( NumberOfWays ( X , Y , M , N ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; 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 ; Console . WriteLine ( log_Expansion ( x , n ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; 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 ] ) ) Console . Write ( a [ i ] + " ▁ " ) ; } } static void Print ( int [ ] arr , int n ) { Console . Write ( " Prime ▁ numbers ▁ in ▁ the ▁ first ▁ half ▁ are ▁ " ) ; prime_range ( 0 , n / 2 , arr ) ; Console . WriteLine ( ) ; Console . Write ( " Prime ▁ numbers ▁ in ▁ the ▁ second ▁ half ▁ are ▁ " ) ; prime_range ( n / 2 , n , arr ) ; Console . WriteLine ( ) ; } 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
C# program:
using System ; 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 ; Console . WriteLine ( countElements ( arr , n ) ) ; } }

Index/key variables: i
Accumulator variables: cnt, i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool 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 int . MinValue ; } public static void Main ( ) { int x = 3 , xsqmodp = 0 , y = 5 , ysqmodp = 1 ; Console . WriteLine ( find_prime ( x , xsqmodp , y , ysqmodp ) ) ; } }

Accumulator variables: j
Iterator variables: j
Class/struct names: GFG
C# program:
using System ; class GFG { static int numberOfMinutes ( int S , int S1 ) { int Min = 0 ; Min = ( int ) ( ( ( S - S1 ) / Math . Floor ( ( double ) S ) ) * 60 ) ; return Min ; } public static void Main ( ) { int S = 30 , S1 = 10 ; Console . WriteLine ( numberOfMinutes ( S , S1 ) + " ▁ min " ) ; } }

Class/struct names: GFG
C# program:
using System ; 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 ( ) { int [ ] a = { 1 , 2 , 3 , 4 , 5 } ; int n = a . Length ; Console . WriteLine ( FindElement ( a , n ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; 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 ) ; } Console . Write ( " { 0 : F9 } " , 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
C# program:
using System ; 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 ( ) { int [ ] arr = { 1 , 5 , 8 , 10 , 12 , 16 } ; int n = arr . Length ; Console . WriteLine ( minimum_elements ( n , arr ) ) ; } }

Index/key variables: i
Accumulator variables: ans, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool 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 ; } static public void Main ( ) { int N = 645 ; int a = 2 ; Console . WriteLine ( Check ( N , a ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; 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 ; } Console . WriteLine ( largest + " ▁ " + smallest ) ; } public static void Main ( String [ ] args ) { int n = 2346 ; Digits ( n ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int factorial ( int n ) { if ( n <= 1 ) return 1 ; return n * factorial ( n - 1 ) ; } static int nCr ( int n , int r ) { return factorial ( n ) / ( factorial ( r ) * factorial ( n - r ) ) ; } static float Probability ( int M , int N , int X ) { return ( float ) ( nCr ( M - N - 1 , X - 2 ) / ( nCr ( M - 1 , X - 1 ) * 1.0 ) ) ; } static void Main ( ) { int M = 9 , X = 3 , N = 4 ; Console . WriteLine ( Probability ( M , N , X ) ) ; } }

Class/struct names: GFG
C# program:
using System ; 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 ( ) { int N = 2 ; Console . WriteLine ( Count_number ( N ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; 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 ) ; } static public void Main ( ) { int N = 10 , M = 5 ; Console . Write ( countWords ( N , M ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void find_length ( int s1 , int s2 ) { if ( s1 <= 0 s2 <= 0 ) { Console . Write ( - 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 ) { Console . WriteLine ( - 1 ) ; return ; } Console . WriteLine ( " Max ▁ = ▁ " + max_length ) ; Console . WriteLine ( " Min ▁ = ▁ " + min_length ) ; } public static void Main ( ) { int s1 = 8 , s2 = 5 ; find_length ( s1 , s2 ) ; } }

Class/struct names: GFG
C# program:
using System ; class geeks { public static int firstSetBit ( int n ) { int x = n & ( n - 1 ) ; return ( n ^ x ) ; } public static void Main ( ) { int n = 12 ; Console . WriteLine ( firstSetBit ( n ) ) ; } }

Class/struct names: geeks
C# program:
using System ; using System . Collections . Generic ; public 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 ) { Dictionary < int , int > prime = new Dictionary < int , int > ( ) ; for ( int i = 2 ; i <= Math . Sqrt ( M ) ; i ++ ) { while ( M % i == 0 ) { if ( ! prime . ContainsKey ( i ) ) prime . Add ( i , 1 ) ; else { int x = prime [ i ] ; prime . Remove ( i ) ; prime . Add ( i , ++ x ) ; } M /= i ; } } if ( M > 1 ) { if ( prime . ContainsKey ( M ) ) { int x = prime [ M ] ; prime . Remove ( M ) ; prime . Add ( M , ++ x ) ; } else prime . Add ( M , 1 ) ; } int ans = 1 ; foreach ( KeyValuePair < int , int > entry in prime ) { ans *= ( nCr ( N + entry . Value - 1 , N - 1 ) ) ; } return ans ; } public static void Main ( String [ ] args ) { int N = 2 , M = 6 ; Console . WriteLine ( NoofSequences ( N , M ) ) ; } }

Index/key variables: M, i
Accumulator variables: M, ans, i, res
Iterator variables: entry, i
Class/struct names: geeks
C# program:
using System ; 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 ; } static public void Main ( ) { int a = 4 , b = 5 , k = 1 ; Console . Write ( findHours ( a , b , k ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int ncr ( int n , int r ) { int ans = 1 ; for ( int i = 1 ; i <= r ; i += 1 ) { ans *= ( n - r + i ) ; ans /= i ; } return ans ; } static int NoOfDistributions ( int N , int R ) { return ncr ( N - 1 , R - 1 ) ; } static public void Main ( ) { int N = 4 ; int R = 3 ; Console . WriteLine ( NoOfDistributions ( N , R ) ) ; } }

Accumulator variables: ans, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int ncr ( int n , int r ) { int ans = 1 ; for ( int i = 1 ; i <= r ; i += 1 ) { ans *= ( n - r + i ) ; ans /= i ; } return ans ; } static int NoOfDistributions ( int N , int R ) { return ncr ( N + R - 1 , R - 1 ) ; } static public void Main ( ) { int N = 4 , R = 3 ; Console . WriteLine ( NoOfDistributions ( N , R ) ) ; } }

Accumulator variables: ans, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool checkPerfectcube ( int n ) { int d = ( int ) Math . Sqrt ( n ) ; if ( d * d * d == n ) return true ; return false ; } static int smallestPerfectCube ( int [ ] a , int n ) { int mini = int . MaxValue ; for ( int i = 0 ; i < n ; i ++ ) { if ( checkPerfectcube ( a [ i ] ) ) { mini = Math . Min ( a [ i ] , mini ) ; } } return mini ; } static public void Main ( ) { int [ ] a = { 16 , 8 , 25 , 2 , 3 , 10 } ; int n = a . Length ; Console . Write ( smallestPerfectCube ( a , n ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void Vertices ( int x , int y ) { int val = Math . Abs ( x ) + Math . Abs ( y ) ; Console . Write ( val * ( x < 0 ? - 1 : 1 ) + " ▁ 0 ▁ " ) ; Console . Write ( "0 ▁ " + val * ( y < 0 ? - 1 : 1 ) ) ; } public static void Main ( String [ ] args ) { int x = 3 , y = 3 ; Vertices ( x , y ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void CheckSubarray ( int [ ] arr , int N ) { int [ ] presum = new int [ N + 1 ] ; for ( int i = 1 ; i <= N ; i += 1 ) { presum [ i ] = presum [ i - 1 ] + arr [ i - 1 ] ; } for ( int i = 1 ; i <= N ; i += 1 ) { for ( int j = i ; j <= N ; j += 1 ) { if ( ( presum [ j ] - presum [ i - 1 ] ) % N == 0 ) { Console . Write ( ( i - 1 ) + " ▁ " + ( j - 1 ) ) ; return ; } } } Console . Write ( - 1 ) ; } public static void Main ( ) { int [ ] arr = { 7 , 5 , 3 , 7 } ; int N = arr . Length ; CheckSubarray ( arr , N ) ; } }

Index/key variables: i, j
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void CheckSubarray ( int [ ] arr , int N ) { int [ ] presum = new int [ N + 1 ] ; for ( int i = 1 ; i <= N ; i += 1 ) { presum [ i ] = presum [ i - 1 ] + arr [ i - 1 ] ; } List < int > [ ] moduloclass = new List < int > [ N ] ; for ( int i = 0 ; i < N ; i += 1 ) { moduloclass [ i ] = new List < int > ( ) ; } for ( int i = 1 ; i <= N ; i += 1 ) { moduloclass [ presum [ i ] % N ] . Add ( i - 1 ) ; } if ( moduloclass [ 0 ] . Count > 0 ) { Console . Write ( 0 + " ▁ " + moduloclass [ 0 ] [ 0 ] ) ; return ; } for ( int i = 1 ; i < N ; i += 1 ) { if ( moduloclass [ i ] . Count >= 2 ) { Console . Write ( moduloclass [ i ] [ 0 ] + 1 + " ▁ " + moduloclass [ i ] [ 1 ] ) ; return ; } } } public static void Main ( String [ ] args ) { int [ ] arr = { 7 , 3 , 5 , 2 } ; int N = arr . Length ; CheckSubarray ( arr , N ) ; } }

Index/key variables: N, i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int countBits ( int n ) { int count = 0 ; while ( n > 0 ) { count ++ ; n >>= 1 ; } return count ; } static int findNearestNumber ( int n ) { int cnt = countBits ( n ) ; cnt -= 1 ; if ( cnt % 2 == 1 ) { return 1 << ( cnt + 1 ) ; } else { int tempnum = 0 ; for ( int i = 0 ; i <= cnt ; i += 2 ) { tempnum += 1 << i ; } if ( tempnum < n ) { return ( 1 << ( cnt + 2 ) ) ; } else if ( tempnum == n ) { return n ; } for ( int i = 0 ; i <= cnt ; i += 2 ) { tempnum -= ( 1 << i ) ; if ( tempnum < n ) { return tempnum += ( 1 << i ) ; } } } return int . MinValue ; } public static void Main ( ) { int n = 19 ; Console . WriteLine ( findNearestNumber ( n ) ) ; } }

Accumulator variables: cnt, count, i, tempnum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int countNum ( int n ) { if ( n == 1 ) return 1 ; int count = ( int ) Math . Pow ( 2 , n - 2 ) ; return count ; } static public void Main ( ) { int n = 3 ; Console . WriteLine ( countNum ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static String constructString ( int n ) { String s = " " ; for ( int i = 0 ; i < n ; i ++ ) { s += "10" ; } return s ; } static int binaryToDecimal ( String n ) { String num = n ; int dec_value = 0 ; int base_t = 1 ; int len = num . Length ; for ( int i = len - 1 ; i >= 0 ; i -- ) { if ( num [ i ] == '1' ) dec_value = dec_value + base_t ; base_t = base_t * 2 ; } return dec_value ; } static int findNumber ( int n ) { String s = constructString ( n - 1 ) ; int num = binaryToDecimal ( s ) ; return num ; } static public void Main ( ) { int n = 4 ; Console . Write ( findNumber ( n ) ) ; } }

Index/key variables: i
Accumulator variables: i, s
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public class Node { public int data ; public Node next ; } ; static Node push ( Node head_ref , int data ) { Node new_node = new Node ( ) ; new_node . data = data ; new_node . next = ( head_ref ) ; ( head_ref ) = new_node ; return head_ref ; } static int bitonic_point ( Node node ) { if ( node == null ) return - 1 ; if ( node . next == null ) return - 1 ; if ( node . data > node . next . data ) return - 1 ; while ( node . next != null ) { if ( node . data > node . next . data ) break ; node = node . next ; } int bitonicPoint = node . data ; while ( node . next != null ) { if ( node . data < node . next . data ) return - 1 ; node = node . next ; } return bitonicPoint ; } public static void Main ( String [ ] args ) { Node head = null ; head = push ( head , 100 ) ; head = push ( head , 201 ) ; head = push ( head , 399 ) ; head = push ( head , 490 ) ; head = push ( head , 377 ) ; head = push ( head , 291 ) ; head = push ( head , 100 ) ; Console . WriteLine ( bitonic_point ( head ) ) ; } }

Class/struct names: GFG, Node
C# program:
using System ; class GFG { static int MinRemove ( int [ ] a , int n , int k ) { int [ ] cnt = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { if ( a [ i ] == 0 ) cnt [ 0 ] ++ ; else if ( cnt [ a [ i ] - 1 ] > 0 ) { cnt [ a [ i ] - 1 ] -- ; cnt [ a [ i ] ] ++ ; } } return n - ( k * cnt [ k - 1 ] ) ; } public static void Main ( String [ ] args ) { int [ ] a = { 0 , 1 , 2 , 3 , 4 , 0 , 1 , 0 , 1 , 2 , 3 , 4 } ; int k = 5 ; int n = a . Length ; Console . WriteLine ( MinRemove ( a , n , k ) ) ; } }

Index/key variables: i, n
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int mosaic ( int n ) { int i , ans = 1 ; for ( i = 2 ; i <= n ; i ++ ) { if ( n % i == 0 && n > 0 ) { int count = 0 ; while ( n % i == 0 ) { n /= i ; count ++ ; } ans *= count * i ; } } return ans ; } static void nMosaicNumbers ( int n ) { for ( int i = 1 ; i <= n ; i ++ ) Console . Write ( mosaic ( i ) + " ▁ " ) ; } public static void Main ( ) { int n = 10 ; nMosaicNumbers ( n ) ; } }

Accumulator variables: ans, count, i, n
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void countNodes ( int N , int X ) { int height = ( int ) Math . Floor ( Math . Log ( N ) / Math . Log ( 2 ) ) ; if ( X > height ) { Console . Write ( "0 STRNEWLINE 0" ) ; return ; } if ( N == 1 ) { Console . Write ( "1 STRNEWLINE 1" ) ; return ; } int max_total_nodes = ( 1 << ( height + 1 ) ) - 1 ; int nodes_last_level = ( 1 << height ) - ( max_total_nodes - N ) ; int from_root ; int from_leaf ; if ( X == height ) from_root = nodes_last_level ; else from_root = 1 << X ; int left_leaf_nodes = ( ( 1 << height ) - nodes_last_level ) / 2 ; if ( X == 0 ) { from_leaf = nodes_last_level + left_leaf_nodes ; } else { int i = X ; while ( nodes_last_level > 1 && i > 0 ) { nodes_last_level = ( int ) Math . Ceiling ( ( float ) nodes_last_level / ( float ) 2 ) ; i -- ; } from_leaf = nodes_last_level ; i = X ; while ( left_leaf_nodes > 1 && i > 0 ) { left_leaf_nodes = ( int ) Math . Ceiling ( ( float ) left_leaf_nodes / ( float ) 2 ) ; i -- ; } from_leaf += left_leaf_nodes ; } Console . Write ( from_root + " STRNEWLINE " + from_leaf ) ; } public static void Main ( ) { int N = 38 , X = 3 ; countNodes ( N , X ) ; } }

Accumulator variables: from_leaf, i
Class/struct names: GFG
C# program:
using System ; class GFG { static int sum_of_4_squares ( int n ) { int i , odd = 0 , even = 0 ; for ( i = 1 ; i <= Math . Sqrt ( n ) ; i ++ ) { if ( n % i == 0 ) { if ( i % 2 == 0 ) even += i ; else odd += i ; if ( ( n / i ) != i ) { if ( ( n / i ) % 2 == 0 ) even += ( n / i ) ; else odd += ( n / i ) ; } } } if ( n % 2 == 1 ) return 8 * ( odd + even ) ; else return 24 * ( odd ) ; } static public void Main ( ) { int n = 4 ; Console . WriteLine ( sum_of_4_squares ( n ) ) ; } }

Accumulator variables: even, i, odd
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int mosaic ( int n ) { int i , ans = 1 ; for ( i = 2 ; i <= n ; i ++ ) { if ( n % i == 0 && n > 0 ) { int count = 0 ; while ( n % i == 0 ) { n /= i ; count ++ ; } ans *= count * i ; } } return ans ; } static public void Main ( ) { int n = 36 ; Console . WriteLine ( mosaic ( n ) ) ; } }

Accumulator variables: ans, count, i, n
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int Total_Ways ( int n ) { int fac = 1 ; for ( int i = 2 ; i <= n - 1 ; i ++ ) { fac = fac * i ; } return ( fac * 2 ) ; } static public void Main ( ) { int n = 5 ; Console . Write ( Total_Ways ( n ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int MaxNumbers ( int [ ] a , int n ) { int [ ] fre = { 0 , 0 , 0 } ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] %= 3 ; fre [ a [ i ] ] ++ ; } int ans = fre [ 0 ] ; int k = Math . Min ( fre [ 1 ] , fre [ 2 ] ) ; ans += k ; fre [ 1 ] -= k ; fre [ 2 ] -= k ; ans += fre [ 1 ] / 3 + fre [ 2 ] / 3 ; return ans ; } static public void Main ( ) { int [ ] a = { 1 , 4 , 10 , 7 , 11 , 2 , 8 , 5 , 9 } ; int n = a . Length ; Console . WriteLine ( MaxNumbers ( a , n ) ) ; } }

Index/key variables: i
Accumulator variables: ans, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class GFG { static int countSetBits ( int n ) { int count = 0 ; while ( n > 0 ) { n &= ( n - 1 ) ; count ++ ; } return count ; } static int pairs ( int [ ] arr , int n , int k ) { int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = i + 1 ; j < n ; j ++ ) { int sum = countSetBits ( arr [ i ] ) + countSetBits ( arr [ j ] ) ; if ( sum == k ) count ++ ; } } return count ; } public static void Main ( String [ ] args ) { int [ ] arr = { 1 , 2 , 3 , 4 , 5 } ; int n = arr . Length ; int k = 4 ; Console . WriteLine ( pairs ( arr , n , k ) ) ; } }

Index/key variables: i, j
Accumulator variables: count, i, j, n
Iterator variables: i, j
Class/struct names: GFG