dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; class GFG { static void minimumDifference ( int N ) { int sum1 = ( 1 << N ) , sum2 = 0 ; for ( int i = 1 ; i < N / 2 ; i ++ ) sum1 += ( 1 << i ) ; for ( int i = N / 2 ; i < N ; i ++ ) sum2 += ( 1 << i ) ; Console . WriteLine ( sum1 - sum2 ) ; } static public void Main ( ) { int N = 4 ; minimumDifference ( N ) ; } }

Accumulator variables: i, sum1, sum2
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isPerfectCube ( int x ) { int cr = ( int ) Math . Cbrt ( x ) ; return ( cr * cr * cr == x ) ; } static void canBePerfectCube ( int N , int K ) { if ( isPerfectCube ( N + K ) || isPerfectCube ( N - K ) == true ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } public static void Main ( string [ ] args ) { int N = 7 ; int K = 1 ; canBePerfectCube ( N , K ) ; N = 5 ; K = 4 ; canBePerfectCube ( N , K ) ; N = 7 ; K = 2 ; canBePerfectCube ( N , K ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int sqrtSearch ( int low , int high , int N ) { if ( low <= high ) { int mid = ( int ) ( low + high ) / 2 ; if ( ( mid * mid <= N ) && ( ( mid + 1 ) * ( mid + 1 ) > N ) ) { return mid ; } else if ( mid * mid < N ) { return sqrtSearch ( mid + 1 , high , N ) ; } else { return sqrtSearch ( low , mid - 1 , N ) ; } } return low ; } public static void Main ( String [ ] args ) { int N = 25 ; Console . WriteLine ( sqrtSearch ( 0 , N , N ) ) ; } }

Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int gcd ( int a , int b ) { if ( a == 0 ) return b ; return gcd ( b % a , a ) ; } static void printAllDivisors ( int [ ] arr , int N ) { int g = arr [ 0 ] ; HashSet < int > divisors = new HashSet < int > ( ) ; for ( int i = 1 ; i < N ; i ++ ) { g = gcd ( arr [ i ] , g ) ; } for ( int i = 1 ; i * i <= g ; i ++ ) { if ( g % i == 0 ) { divisors . Add ( i ) ; if ( g / i != i ) divisors . Add ( g / i ) ; } } foreach ( int it in divisors ) Console . Write ( it + " ▁ " ) ; } public static void Main ( String [ ] args ) { int [ ] arr = { 6 , 90 , 12 , 18 , 30 , 24 } ; int n = arr . Length ; printAllDivisors ( arr , n ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i, it
Class/struct names: GFG
C# program:
using System ; class GFG { static void mul_table ( int N , int i ) { if ( i > 10 ) return ; Console . WriteLine ( N + " ▁ * ▁ " + i + " ▁ = ▁ " + N * i ) ; mul_table ( N , i + 1 ) ; } public static void Main ( ) { int N = 8 ; mul_table ( N , 1 ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static bool isPrime ( int n ) { if ( n <= 1 ) return false ; for ( int i = 2 ; i < n ; i ++ ) { if ( n % i == 0 ) return false ; } return true ; } static int getSmallestPrimefactor ( int n ) { for ( int i = 2 ; i <= Math . Sqrt ( n ) ; i ++ ) { if ( n % i == 0 ) return i ; } return - 1 ; } public static void Main ( ) { int N = 100 ; int a ; a = getSmallestPrimefactor ( N ) ; if ( isPrime ( N / a ) ) { Console . Write ( " - 1" ) ; } else { Console . Write ( N / a ) ; } } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool checkEqualNo ( int m , int n , int a , int b ) { if ( m <= n ) { if ( ( n - m ) % ( a + b ) == 0 ) { return true ; } else { return false ; } } else { return false ; } } public static void Main ( String [ ] args ) { int M = 2 ; int N = 8 ; int A = 3 ; int B = 3 ; if ( checkEqualNo ( M , N , A , B ) == true ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static bool ispalin ( int num ) { string s = num . ToString ( ) ; int st = 0 ; int ed = s . Length - 1 ; while ( st <= ed ) { if ( s [ st ] != s [ ed ] ) return false ; st ++ ; ed -- ; } return true ; } static void CalculateXORandOR ( int n ) { int CalculateXOR = 0 ; int CalculateOR = 0 ; int start = ( int ) Math . Pow ( 10 , n - 1 ) ; int end = ( int ) Math . Pow ( 10 , n ) - 1 ; for ( int i = start ; i <= end ; i ++ ) { if ( ispalin ( i ) ) { CalculateXOR = CalculateXOR ^ i ; CalculateOR = CalculateOR | i ; } } Console . Write ( " XOR ▁ = ▁ " + CalculateXOR ) ; Console . WriteLine ( " ▁ OR ▁ = ▁ " + CalculateOR ) ; } public static void Main ( string [ ] args ) { int n = 4 ; CalculateXORandOR ( n ) ; } }

Index/key variables: ed, st
Accumulator variables: ed, i, st
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int [ ] pref = new int [ 100001 ] ; static int checkPalindrome ( int num ) { String str = String . Join ( " " , num ) ; int l = 0 , r = str . Length - 1 ; while ( l < r ) { if ( str [ l ] != str [ r ] ) { return 0 ; } l ++ ; r -- ; } return num ; } static void preCompute ( ) { for ( int i = 1 ; i <= 100000 ; ++ i ) { pref [ i ] = pref [ i - 1 ] + checkPalindrome ( i ) ; } } static void printSum ( int L , int R ) { Console . Write ( pref [ R ] - pref [ L - 1 ] + " STRNEWLINE " ) ; } static void printSumPalindromic ( int [ , ] arr , int Q ) { preCompute ( ) ; for ( int i = 0 ; i < Q ; i ++ ) { printSum ( arr [ i , 0 ] , arr [ i , 1 ] ) ; } } public static void Main ( String [ ] args ) { int Q = 2 ; int [ , ] arr = { { 10 , 13 } , { 12 , 21 } } ; printSumPalindromic ( arr , Q ) ; } }

Index/key variables: R, i, l, r
Accumulator variables: i, l, r
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int summation ( int n ) { int sum = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { if ( i % 2 == 1 ) sum += ( i * i ) ; else sum -= ( i * i ) ; } return sum ; } public static void Main ( ) { int N = 2 ; Console . WriteLine ( summation ( N ) ) ; } }

Accumulator variables: i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class GFG { static int summation ( int n ) { int abs_sum = ( int ) ( n * ( n + 1 ) / 2 ) ; int sign = n + 1 % 2 == 0 ? 1 : - 1 ; int result_sum = sign * abs_sum ; return result_sum ; } public static void Main ( ) { int N = 2 ; Console . WriteLine ( summation ( N ) ) ; } }

Class/struct names: GFG
C# program:
using System ; public class GFG { static int countPairs ( int n ) { int count = 0 ; for ( int x = 1 ; x < n ; x ++ ) { for ( int y = x + 1 ; y <= n ; y ++ ) { if ( ( y + x ) % ( y ^ x ) == 0 ) count ++ ; } } return count ; } public static void Main ( ) { int n = 6 ; Console . WriteLine ( countPairs ( n ) ) ; } }

Accumulator variables: count, x, y
Iterator variables: x, y
Class/struct names: GFG
C# program:
using System ; public class GFG { static bool isPower ( int x , int y ) { int res1 = ( int ) ( Math . Log ( y ) / Math . Log ( x ) ) ; double res2 = Math . Log ( y ) / Math . Log ( x ) ; return ( res1 == res2 ) ; } static int countPower ( int [ ] arr , int n ) { int res = 0 ; for ( int i = 0 ; i < n ; i ++ ) for ( int j = i + 1 ; j < n ; j ++ ) if ( isPower ( arr [ i ] , arr [ j ] ) || isPower ( arr [ j ] , arr [ i ] ) ) res ++ ; return res ; } public static void Main ( ) { int [ ] a = { 16 , 2 , 3 , 9 } ; int n = a . Length ; Console . WriteLine ( countPower ( a , n ) ) ; } }

Index/key variables: i, j
Accumulator variables: i, j, res
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int xor_all_elements ( int n ) { switch ( n & 3 ) { case 0 : return n ; case 1 : return 1 ; case 2 : return n + 1 ; } return 0 ; } static List < int > findArray ( int [ ] xorr , int n ) { List < int > arr = new List < int > ( ) ; int xor_all = xor_all_elements ( n ) ; int xor_adjacent = 0 ; for ( int i = 0 ; i < n - 1 ; i += 2 ) { xor_adjacent = xor_adjacent ^ xorr [ i ] ; } int last_element = xor_all ^ xor_adjacent ; arr . Add ( last_element ) ; for ( int i = n - 2 ; i >= 0 ; i -- ) { last_element = xorr [ i ] ^ last_element ; arr . Add ( last_element ) ; } return arr ; } public static void Main ( String [ ] args ) { List < int > arr = new List < int > ( ) ; int [ ] xorr = { 7 , 5 , 3 , 7 } ; int n = 5 ; arr = findArray ( xorr , n ) ; for ( int i = n - 1 ; i >= 0 ; i -- ) { Console . Write ( arr [ i ] + " ▁ " ) ; } } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int sumOfParts ( int [ , ] arr , int N ) { int sum_part1 = 0 , sum_part2 = 0 , sum_part3 = 0 , sum_part4 = 0 ; int totalsum = 0 ; for ( int i = 0 ; i < N ; i ++ ) { for ( int j = 0 ; j < N ; j ++ ) { if ( i + j < N - 1 ) { if ( i < j && i != j && i + j > 0 ) sum_part1 += arr [ i , j ] ; else if ( i != j ) sum_part2 += arr [ i , j ] ; } else { if ( i > j && i + j != N - 1 ) sum_part3 += arr [ i , j ] ; else { if ( i + j != N - 1 && i != j ) sum_part4 += arr [ i , j ] ; } } } } totalsum = sum_part1 + sum_part2 + sum_part3 + sum_part4 ; return totalsum ; } public static void Main ( ) { int N = 4 ; int [ , ] arr = { { 1 , 2 , 3 , 4 } , { 5 , 6 , 7 , 8 } , { 9 , 10 , 11 , 12 } , { 13 , 14 , 15 , 16 } } ; Console . WriteLine ( sumOfParts ( arr , N ) ) ; } }

Accumulator variables: i, j, sum_part1, sum_part2, sum_part3, sum_part4
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static void ifPossible ( int X , int Y ) { if ( X > Y ) swap ( X , Y ) ; if ( ( X + Y ) % 5 == 0 && 3 * X >= 2 * Y ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } static void swap ( int x , int y ) { int temp = x ; x = y ; y = temp ; } public static void Main ( ) { int X = 33 , Y = 27 ; ifPossible ( X , Y ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void findNumbers ( int n ) { String ans = strings ( n - 1 , ' F ' ) ; String even = ans + ' E ' ; String odd = ans + ' F ' ; Console . Write ( " Even : ▁ " + even + " STRNEWLINE " ) ; Console . Write ( " Odd : ▁ " + odd + " STRNEWLINE " ) ; } private static String strings ( int n , char c ) { String str = " " ; for ( int i = 0 ; i < n ; i ++ ) str += c ; return str ; } public static void Main ( String [ ] args ) { int n = 2 ; findNumbers ( n ) ; } }

Accumulator variables: i, str
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class GFG { static int log_a_to_base_b ( int a , int b ) { return ( int ) ( Math . Log ( a ) / Math . Log ( b ) ) ; } public static void Main ( ) { int a = 3 ; int b = 2 ; Console . WriteLine ( log_a_to_base_b ( a , b ) ) ; a = 256 ; b = 4 ; Console . WriteLine ( log_a_to_base_b ( a , b ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int log_a_to_base_b ( int a , int b ) { int rslt = ( a > b - 1 ) ? 1 + log_a_to_base_b ( a / b , b ) : 0 ; return rslt ; } public static void Main ( ) { int a = 3 ; int b = 2 ; Console . WriteLine ( log_a_to_base_b ( a , b ) ) ; a = 256 ; b = 4 ; Console . WriteLine ( log_a_to_base_b ( a , b ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static string findLargest ( int N ) { string largest = " " ; for ( int i = 0 ; i < N ; i ++ ) largest += ' F ' ; return largest ; } static string findSmallest ( int N ) { string smallest = "1" ; for ( int i = 0 ; i < N - 1 ; i ++ ) smallest += '0' ; return smallest ; } static void print ( int largest ) { Console . WriteLine ( " Largest : ▁ " + findLargest ( largest ) ) ; Console . WriteLine ( " Smallest : ▁ " + findSmallest ( largest ) ) ; } public static void Main ( string [ ] args ) { int N = 4 ; print ( N ) ; } }

Accumulator variables: i, largest, smallest
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int prevPowerofK ( int n , int k ) { int p = ( int ) ( Math . Log ( n ) / Math . Log ( k ) ) ; return ( int ) Math . Pow ( k , p ) ; } static int nextPowerOfK ( int n , int k ) { return prevPowerofK ( n , k ) * k ; } static void printResult ( int n , int k ) { Console . WriteLine ( prevPowerofK ( n , k ) + " ▁ " + nextPowerOfK ( n , k ) ) ; } public static void Main ( String [ ] args ) { int n = 25 , k = 3 ; printResult ( n , k ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void canMake ( int n , int [ ] ar ) { int sum = 0 , maxx = - 1 ; for ( int i = 0 ; i < n ; i ++ ) { sum += ar [ i ] ; maxx = Math . Max ( maxx , ar [ i ] ) ; } if ( n == 1 sum % 2 == 1 sum - maxx < maxx ) { Console . Write ( " No STRNEWLINE " ) ; } else { Console . Write ( " Yes STRNEWLINE " ) ; } } public static void Main ( String [ ] args ) { int n = 6 ; int [ ] arr = { 1 , 1 , 2 , 3 , 6 , 11 } ; canMake ( n , arr ) ; } }

Index/key variables: i
Accumulator variables: i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int [ ] pref = new int [ 100010 ] ; static int isPerfectSquare ( int x ) { double sr = Math . Sqrt ( x ) ; return ( ( sr - Math . Floor ( sr ) ) == 0 ) ? x : 0 ; } static void compute ( ) { for ( int i = 1 ; i <= 100000 ; ++ i ) { pref [ i ] = pref [ i - 1 ] + isPerfectSquare ( i ) ; } } static void printSum ( int L , int R ) { int sum = pref [ R ] - pref [ L - 1 ] ; Console . Write ( sum + " ▁ " ) ; } public static void Main ( String [ ] args ) { compute ( ) ; int Q = 4 ; int [ , ] arr = { { 1 , 10 } , { 1 , 100 } , { 2 , 25 } , { 4 , 50 } } ; for ( int i = 0 ; i < Q ; i ++ ) { printSum ( arr [ i , 0 ] , arr [ i , 1 ] ) ; } } }

Index/key variables: R, i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void factors ( int n , int i ) { if ( i <= n ) { if ( n % i == 0 ) { Console . WriteLine ( i + " ▁ " ) ; } factors ( n , i + 1 ) ; } } public static void Main ( ) { int n = 16 ; factors ( n , 1 ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int maxValue ( int n ) { return n ; } public static void Main ( String [ ] args ) { int n = 1 ; Console . Write ( maxValue ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { public static int solve ( int n ) { int ans = ( n * n / 4 ) ; return ans ; } public static void Main ( ) { int n = 10 ; Console . WriteLine ( solve ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { public static void printMultiples ( int N ) { for ( int i = 1 ; i <= N ; i ++ ) { for ( int j = 1 ; j <= i ; j ++ ) { Console . Write ( ( i * j ) + " ▁ " ) ; } Console . WriteLine ( ) ; } } public static void Main ( String [ ] args ) { int N = 5 ; printMultiples ( N ) ; } }

Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static void nature_of_roots ( int a , int b , int c ) { if ( a == 0 ) { Console . Write ( " Not ▁ a ▁ Quadratic ▁ Equation " + " STRNEWLINE " ) ; return ; } int D = b * b - 4 * a * c ; if ( D > 0 ) { Console . Write ( " Real ▁ Roots " + " STRNEWLINE " ) ; } else if ( D == 0 ) { Console . Write ( " Equal ▁ Roots " + " STRNEWLINE " ) ; } else { Console . Write ( " Imaginary ▁ Roots " + " STRNEWLINE " ) ; } } static void checkForAllTestCase ( ) { Console . Write ( " Testcase " + " TABSYMBOL a TABSYMBOL b TABSYMBOL c TABSYMBOL Actual ▁ Output " + " STRNEWLINE " ) ; Console . WriteLine ( ) ; int a , b , c ; a = b = c = 0 ; int testcase = 1 ; while ( testcase <= 13 ) { if ( testcase == 1 ) { a = 0 ; b = 50 ; c = 50 ; } else if ( testcase == 2 ) { a = 1 ; b = 50 ; c = 50 ; } else if ( testcase == 3 ) { a = 50 ; b = 50 ; c = 50 ; } else if ( testcase == 4 ) { a = 99 ; b = 50 ; c = 50 ; } else if ( testcase == 5 ) { a = 100 ; b = 50 ; c = 50 ; } else if ( testcase == 6 ) { a = 50 ; b = 0 ; c = 50 ; } else if ( testcase == 7 ) { a = 50 ; b = 1 ; c = 50 ; } else if ( testcase == 8 ) { a = 50 ; b = 99 ; c = 50 ; } else if ( testcase == 9 ) { a = 50 ; b = 100 ; c = 50 ; } else if ( testcase == 10 ) { a = 50 ; b = 50 ; c = 0 ; } else if ( testcase == 11 ) { a = 50 ; b = 50 ; c = 1 ; } else if ( testcase == 12 ) { a = 50 ; b = 50 ; c = 99 ; } else if ( testcase == 13 ) { a = 50 ; b = 50 ; c = 100 ; } Console . Write ( " TABSYMBOL " + testcase + " TABSYMBOL " + a + " TABSYMBOL " + b + " TABSYMBOL " + c + " TABSYMBOL " ) ; nature_of_roots ( a , b , c ) ; Console . WriteLine ( ) ; testcase ++ ; } } public static void Main ( String [ ] args ) { checkForAllTestCase ( ) ; } }

Accumulator variables: testcase
Class/struct names: GFG
C# program:
using System ; class GFG { static int isPossible ( int N , int S , int C , int H , int L , int T ) { int total_time_required = S * C * H ; int available_time_after_vacation = ( N - L ) * T ; if ( available_time_after_vacation >= total_time_required ) return 1 ; return 0 ; } public static void Main ( String [ ] args ) { int N = 12 , S = 5 , C = 8 , H = 3 , L = 2 , T = 20 ; if ( isPossible ( N , S , C , H , L , T ) == 1 ) Console . Write ( " Yes " + " STRNEWLINE " ) ; else Console . Write ( " No " + " STRNEWLINE " ) ; N = 1 ; S = 2 ; C = 3 ; H = 4 ; L = 5 ; T = 6 ; if ( isPossible ( N , S , C , H , L , T ) == 1 ) Console . Write ( " Yes " + " STRNEWLINE " ) ; else Console . Write ( " No " + " STRNEWLINE " ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int maximum ( int x , int y ) { return ( ( x + y + Math . Abs ( x - y ) ) / 2 ) ; } static int minimum ( int x , int y ) { return ( ( x + y - Math . Abs ( x - y ) ) / 2 ) ; } public static void Main ( ) { int x = 99 , y = 18 ; Console . WriteLine ( " Maximum : ▁ " + maximum ( x , y ) ) ; Console . WriteLine ( " Minimum : ▁ " + minimum ( x , y ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void SubarraysWithSumS ( int n , int k , int s ) { for ( int i = 0 ; i < k ; i ++ ) Console . Write ( s + " ▁ " ) ; for ( int i = k ; i < n ; i ++ ) Console . Write ( s + 1 + " ▁ " ) ; } public static void Main ( String [ ] args ) { int n = 4 , k = 2 , s = 3 ; SubarraysWithSumS ( n , k , s ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int pay ( int n ) { int cuts = ( int ) ( Math . Log ( n ) / Math . Log ( 2 ) ) ; return cuts ; } public static void Main ( String [ ] args ) { int n = 5 ; int cuts = pay ( n ) ; Console . Write ( cuts + " STRNEWLINE " ) ; n = 15 ; cuts = pay ( n ) ; Console . Write ( cuts ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int MAX = 100000 ; static int [ ] max_prime = new int [ MAX + 1 ] ; static int [ ] min_prime = new int [ MAX + 1 ] ; static void sieve ( int n ) { for ( int i = 2 ; i <= n ; ++ i ) { if ( min_prime [ i ] > 0 ) { continue ; } min_prime [ i ] = i ; max_prime [ i ] = i ; int j = i + i ; while ( j <= n ) { if ( min_prime [ j ] == 0 ) { min_prime [ j ] = i ; } max_prime [ j ] = i ; j += i ; } } } static void findSum ( int [ ] arr , int n ) { sieve ( MAX ) ; for ( int i = 0 ; i < n ; i ++ ) { int sum = min_prime [ arr [ i ] ] + max_prime [ arr [ i ] ] ; Console . Write ( sum + " ▁ " ) ; } } public static void Main ( String [ ] args ) { int [ ] arr = { 5 , 10 , 15 , 20 , 25 , 30 } ; int n = arr . Length ; findSum ( arr , n ) ; } }

Index/key variables: i, j
Accumulator variables: i, j
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int pairCount ( int n , int m ) { int cnt = 0 , b , a ; for ( b = 0 ; b <= Math . Sqrt ( m ) ; b ++ ) { a = m - b * b ; if ( a * a + b == n ) { cnt ++ ; } } return cnt ; } public static void Main ( String [ ] args ) { int n = 9 , m = 3 ; Console . Write ( pairCount ( n , m ) + " STRNEWLINE " ) ; } }

Accumulator variables: b, cnt
Iterator variables: b
Class/struct names: GFG
C# program:
using System ; class GFG { static int maxin = 10001 ; static int [ ] divisors = new int [ maxin + 1 ] ; static void Calc_Max_Div ( int [ ] arr , int n ) { int [ ] vis = new int [ maxin + 1 ] ; for ( int i = 0 ; i < maxin + 1 ; i ++ ) vis [ i ] = 1 ; vis [ 0 ] = vis [ 1 ] = 0 ; for ( int i = 1 ; i <= maxin ; i ++ ) divisors [ i ] = i ; for ( int i = 4 ; i <= maxin ; i += 2 ) { vis [ i ] = 0 ; divisors [ i ] = i / 2 ; } for ( int i = 3 ; i <= maxin ; i += 2 ) { if ( divisors [ i ] != i ) { divisors [ i ] = i / divisors [ i ] ; } if ( vis [ i ] == 1 ) { for ( int j = i * i ; j < maxin ; j += i ) { vis [ j ] = 0 ; if ( divisors [ j ] == j ) divisors [ j ] = i ; } } } for ( int i = 0 ; i < n ; i ++ ) { if ( divisors [ arr [ i ] ] == arr [ i ] ) Console . Write ( " - 1 ▁ " ) ; else Console . Write ( divisors [ arr [ i ] ] + " ▁ " ) ; } } public static void Main ( ) { int [ ] arr = { 5 , 6 , 7 , 8 , 9 , 10 } ; int n = arr . Length ; Calc_Max_Div ( arr , n ) ; } }

Index/key variables: i, j
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int sumOfDigit ( int n , int b ) { int unitDigit , sum = 0 ; while ( n > 0 ) { unitDigit = n % b ; sum += unitDigit ; n = n / b ; } return sum ; } public static void Main ( String [ ] args ) { int n = 50 ; int b = 2 ; Console . Write ( sumOfDigit ( n , b ) ) ; } }

Accumulator variables: sum
Class/struct names: GFG
C# program:
using System ; class GFG { static int nthDigit ( int a , int n , int b ) { for ( int i = 1 ; i < n ; i ++ ) a = a / b ; return a % b ; } public static void Main ( ) { int a = 100 ; int n = 3 ; int b = 4 ; Console . Write ( nthDigit ( a , n , b ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int MAX = 100001 ; static List < int > primes = new List < int > ( ) ; static void initialize ( ) { bool [ ] numbers = new bool [ MAX + 1 ] ; int n = MAX ; for ( int i = 2 ; i * i <= n ; i ++ ) if ( ! numbers [ i ] ) for ( int j = i * i ; j <= n ; j += i ) numbers [ j ] = true ; for ( int i = 2 ; i <= n ; i ++ ) if ( numbers [ i ] == false ) primes . Add ( i ) ; } static void findNums ( int num ) { bool ans = false ; int first = - 1 , second = - 1 , third = - 1 ; for ( int i = 0 ; i < num ; i ++ ) { first = primes [ i ] ; for ( int j = 0 ; j < num ; j ++ ) { second = primes [ j ] ; third = num - first - second ; if ( Array . BinarySearch ( primes . ToArray ( ) , third ) >= 0 ) { ans = true ; break ; } } if ( ans ) break ; } if ( ans ) Console . WriteLine ( first + " ▁ " + second + " ▁ " + third ) ; else Console . WriteLine ( - 1 ) ; } static void Main ( ) { int n = 101 ; initialize ( ) ; findNums ( n ) ; } }

Index/key variables: i, j
Accumulator variables: i, j
Iterator variables: i, j
Boolean variables: ans
Class/struct names: GFG
C# program:
using System ; class GFG { static void printmaxSubseq ( int [ ] arr , int n ) { int i ; for ( i = 0 ; i < n ; i ++ ) { if ( i + 1 < n && arr [ i ] < arr [ i + 1 ] ) Console . Write ( arr [ i ] + " ▁ " ) ; else Console . WriteLine ( arr [ i ] ) ; } } public static void Main ( ) { int [ ] arr = { 9 , 8 , 11 , 13 , 10 , 15 , 14 , 16 , 20 , 5 } ; int n = arr . Length ; printmaxSubseq ( arr , n ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int countSum ( int N , int L , int R ) { if ( L > R ) { return 0 ; } if ( N == 1 ) { return R - L + 1 ; } if ( N > 1 ) { return ( N - 2 ) * ( R - L ) + 1 ; } return 0 ; } public static void Main ( String [ ] args ) { int N = 4 , L = 4 , R = 6 ; Console . Write ( countSum ( N , L , R ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int INT_MAX = int . MaxValue ; static int solve ( int [ ] arr , int n , int k ) { int minx = INT_MAX ; int i ; for ( i = 0 ; i < n ; i ++ ) { minx = Math . Min ( minx , arr [ i ] ) ; } int decrements = 0 ; for ( i = 0 ; i < n ; i ++ ) { if ( ( arr [ i ] - minx ) % k != 0 ) { return - 1 ; } else { decrements += ( ( arr [ i ] - minx ) / k ) ; } } return decrements ; } public static void Main ( ) { int n , k ; n = 3 ; k = 3 ; int [ ] arr = { 12 , 9 , 15 } ; Console . WriteLine ( solve ( arr , n , k ) ) ; } }

Index/key variables: i
Accumulator variables: decrements, i
Iterator variables: i
Class/struct names: GFG