dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; using System . Linq ; class GFG { static void printArr ( int [ ] arr , int n ) { for ( int i = 0 ; i < n ; i ++ ) Console . Write ( arr [ i ] + " ▁ " ) ; } static void IncrementFactors ( int [ ] count , int val ) { for ( int i = 1 ; i * i <= val ; i ++ ) { if ( val % i == 0 ) { if ( i == val / i ) { count [ i ] ++ ; } else { count [ i ] ++ ; count [ val / i ] ++ ; } } } } static void generateArr ( int [ ] A , int n ) { int [ ] B = new int [ n ] ; int maxi = A . Max ( ) ; int [ ] count = new int [ maxi + 1 ] ; for ( int i = 0 ; i < n ; i ++ ) { B [ i ] = count [ A [ i ] ] ; IncrementFactors ( count , A [ i ] ) ; } printArr ( B , n ) ; } public static void Main ( String [ ] args ) { int [ ] arr = { 8 , 1 , 28 , 4 , 2 , 6 , 7 } ; int n = arr . Length ; generateArr ( arr , n ) ; } }

Index/key variables: i, n
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections ; using System . Collections . Generic ; class GFG { static List < int > SieveOfEratosthenes ( int n ) { bool [ ] prime = new bool [ 2 * n + 1 ] ; Array . Fill ( prime , true ) ; for ( int p = 2 ; p * p <= 2 * n ; p ++ ) { if ( prime [ p ] == true ) { for ( int i = p * p ; i <= 2 * n ; i += p ) prime [ i ] = false ; } } List < int > primes = new List < int > ( ) ; for ( int p = 2 ; p <= 2 * n ; p ++ ) if ( prime [ p ] ) primes . Add ( p ) ; return primes ; } static int minChanges ( int [ ] arr ) { int n = arr . Length ; int ans = 0 ; int maxi = arr [ 0 ] ; for ( int i = 1 ; i < arr . Length ; i ++ ) maxi = Math . Max ( maxi , arr [ i ] ) ; List < int > primes = SieveOfEratosthenes ( maxi ) ; for ( int i = 0 ; i < n ; i ++ ) { int x = - 1 ; for ( int j = 0 ; j < primes . Count ; j ++ ) { if ( arr [ i ] == primes [ j ] ) { x = j ; break ; } else if ( arr [ i ] < primes [ j ] ) { x = j ; break ; } } int minm = Math . Abs ( primes [ x ] - arr [ i ] ) ; if ( x > 1 ) { minm = Math . Min ( minm , Math . Abs ( primes [ x - 1 ] - arr [ i ] ) ) ; } ans += minm ; } return ans ; } public static void Main ( string [ ] args ) { int [ ] arr = { 4 , 25 , 13 , 6 , 20 } ; Console . Write ( minChanges ( arr ) ) ; } }

Index/key variables: i, j, p, x
Accumulator variables: ans, i, j, p
Iterator variables: i, j, p
Class/struct names: GFG
C# program:
using System ; class GFG { static int calcSum ( int k , int n ) { int value = ( k * n * ( n + 1 ) ) / 2 ; return value ; } static int findSum ( int [ ] a , int n , int L , int R ) { int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( L % a [ i ] == 0 && L != 0 ) { sum += calcSum ( a [ i ] , R / a [ i ] ) - calcSum ( a [ i ] , ( L - 1 ) / a [ i ] ) ; } else { sum += calcSum ( a [ i ] , R / a [ i ] ) - calcSum ( a [ i ] , L / a [ i ] ) ; } } return sum ; } public static void Main ( string [ ] args ) { int [ ] arr = new int [ ] { 2 , 7 , 3 , 8 } ; int N = arr . Length ; int L = 7 ; int R = 20 ; Console . Write ( findSum ( arr , N , L , R ) ) ; } }

Index/key variables: i
Accumulator variables: i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int maxN = 1000000 ; static int [ ] arr = new int [ 1000001 ] ; static int [ ] prefix = new int [ 1000001 ] ; static void findPrimes ( ) { for ( int i = 1 ; i <= maxN ; i ++ ) arr [ i ] = 1 ; arr [ 0 ] = 0 ; arr [ 1 ] = 0 ; for ( int i = 2 ; i * i <= maxN ; i ++ ) { if ( arr [ i ] == 1 ) { for ( int j = i * i ; j <= maxN ; j += i ) { arr [ j ] = 0 ; } } } int sum = 0 ; prefix [ 0 ] = 0 ; for ( int i = 1 ; i <= maxN ; i ++ ) { if ( arr [ i ] == 1 ) { int temp = i ; sum = 0 ; while ( temp > 0 ) { int x = temp % 10 ; sum += x ; temp = temp / 10 ; if ( arr [ sum ] == 1 ) { prefix [ i ] = 1 ; } else { prefix [ i ] = 0 ; } } } } for ( int i = 1 ; i <= maxN ; i ++ ) { prefix [ i ] += prefix [ i - 1 ] ; } } static void countNumbersInRange ( int l , int r ) { findPrimes ( ) ; int result = prefix [ r ] - prefix [ l - 1 ] ; Console . Write ( result + " STRNEWLINE " ) ; } public static void Main ( ) { int l , r ; l = 5 ; r = 20 ; countNumbersInRange ( l , r ) ; } }

Index/key variables: i, j, r, sum
Accumulator variables: i, j, sum
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static double get_concentration ( double mass , double volume ) { if ( volume == 0 ) return - 1 ; else return ( mass / volume ) * 1000 ; } public static void Main ( ) { double mass , volume ; mass = 100.00 ; volume = 500.00 ; Console . Write ( get_concentration ( mass , volume ) ) ; } }

Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static bool isSubsetSum ( List < int > set , int n , int sum ) { bool [ , ] subset = new bool [ n + 1 , sum + 1 ] ; for ( int i = 0 ; i <= n ; i ++ ) subset [ i , 0 ] = true ; for ( int i = 1 ; i <= sum ; i ++ ) subset [ 0 , i ] = false ; for ( int i = 1 ; i <= n ; i ++ ) { for ( int j = 1 ; j <= sum ; j ++ ) { if ( j < set [ i - 1 ] ) subset [ i , j ] = subset [ i - 1 , j ] ; if ( j >= set [ i - 1 ] ) subset [ i , j ] = subset [ i - 1 , j ] || subset [ i - 1 , j - set [ i - 1 ] ] ; } } return subset [ n , sum ] ; } static void storeDivisors ( int n , List < int > div ) { for ( int i = 1 ; i <= Math . Sqrt ( n ) ; i ++ ) { if ( n % i == 0 ) { if ( i == ( n / i ) ) div . Add ( i ) ; else { div . Add ( i ) ; div . Add ( n / i ) ; } } } } static bool isPractical ( int N ) { List < int > div = new List < int > ( ) ; storeDivisors ( N , div ) ; for ( int i = 1 ; i < N ; i ++ ) { if ( ! isSubsetSum ( div , div . Count , i ) ) return false ; } return true ; } public static void Main ( String [ ] args ) { int N = 18 ; if ( isPractical ( N ) == true ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } }

Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static bool isDivBySubsetSums ( List < int > arr , int num ) { int n = arr . Count ; long total = 1 << n ; for ( long i = 0 ; i < total ; i ++ ) { long sum = 0 ; for ( int j = 0 ; j < n ; j ++ ) if ( ( i & ( 1 << j ) ) > 0 ) sum += arr [ j ] ; if ( sum != 0 && num % sum != 0 ) return false ; } return true ; } static bool isSuperNivenNum ( int n ) { int temp = n ; List < int > digits = new List < int > ( ) ; while ( n != 0 ) { int digit = n % 10 ; digits . Add ( digit ) ; n = n / 10 ; } return isDivBySubsetSums ( digits , temp ) ; } public static void Main ( String [ ] args ) { int n = 500 ; if ( isSuperNivenNum ( n ) ) Console . Write ( " yes " ) ; else Console . Write ( " No " ) ; } }

Index/key variables: j
Accumulator variables: i, j, sum
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int divCount ( int n ) { bool [ ] hash = new bool [ n + 1 ] ; for ( int i = 0 ; i < n + 1 ; i ++ ) hash [ i ] = true ; for ( int p = 2 ; p * p < n ; p ++ ) if ( hash [ p ] == true ) for ( int i = p * 2 ; i < n ; i += p ) hash [ i ] = false ; int total = 1 ; for ( int p = 2 ; p <= n ; p ++ ) { if ( hash [ p ] ) { int count = 0 ; if ( n % p == 0 ) { while ( n % p == 0 ) { n = n / p ; count ++ ; } total = total * ( count + 1 ) ; } } } return total ; } static bool isHighlyCompositeNumber ( int N ) { int NdivCount = divCount ( N ) ; for ( int i = 1 ; i < N ; i ++ ) { int idivCount = divCount ( i ) ; if ( idivCount >= NdivCount ) return false ; } return true ; } public static void Main ( String [ ] args ) { int N = 12 ; if ( isHighlyCompositeNumber ( N ) ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } }

Index/key variables: i, p
Accumulator variables: count, i, p
Iterator variables: i, p
Class/struct names: GFG
C# program:
using System ; class GFG { static int PentacontahenagonNum ( int N ) { return ( 49 * N * N - 47 * N ) / 2 ; } public static void Main ( ) { int N = 3 ; Console . Write ( "3rd ▁ Pentacontahenagon ▁ Number ▁ is ▁ " + PentacontahenagonNum ( N ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static bool isSaintExuperyNum ( int n ) { for ( int i = 1 ; i <= n / 3 ; i ++ ) { for ( int j = i + 1 ; j <= n / 2 ; j ++ ) { int k = n / i / j ; if ( i * i + j * j == k * k ) { if ( i * j * k == n ) return true ; } } } return false ; } public static void Main ( ) { int N = 60 ; if ( isSaintExuperyNum ( N ) ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } }

Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isRepdigit ( int num , int b ) { int prev = - 1 ; while ( num != 0 ) { int digit = num % b ; num /= b ; if ( prev != - 1 && digit != prev ) return false ; prev = digit ; } return true ; } public static void Main ( ) { int num = 2000 , base1 = 7 ; if ( isRepdigit ( num , base1 ) ) { Console . Write ( " Yes " ) ; } else { Console . Write ( " No " ) ; } } }

Accumulator variables: num
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isComposite ( int n ) { if ( n <= 3 ) return false ; if ( n % 2 == 0 n % 3 == 0 ) return true ; for ( int i = 5 ; i * i <= n ; i = i + 6 ) if ( n % i == 0 || n % ( i + 2 ) == 0 ) return true ; return false ; } static String concatenatePrimeFactors ( int n ) { String concatenate = " " ; if ( n % 2 == 0 ) { concatenate += "2" ; while ( n % 2 == 0 ) n = n / 2 ; } for ( int i = 3 ; i <= Math . Sqrt ( n ) ; i = i + 2 ) { if ( n % i == 0 ) { concatenate += i ; while ( n % i == 0 ) n = n / i ; } } if ( n > 2 ) concatenate += n ; return concatenate ; } static bool isEnlightened ( int N ) { if ( ! isComposite ( N ) ) return false ; String num = String . Join ( " " , N ) ; String prefixConc = concatenatePrimeFactors ( N ) ; return num . StartsWith ( prefixConc ) ; } public static void Main ( String [ ] args ) { int n = 250 ; if ( isEnlightened ( n ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Accumulator variables: concatenate
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void findNthTerm ( int n ) { Console . Write ( n * ( 3 * n + 1 ) / 2 + " STRNEWLINE " ) ; } public static void Main ( ) { int N = 4 ; findNthTerm ( N ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static bool isIdoneal ( int n ) { for ( int a = 1 ; a <= n ; a ++ ) { for ( int b = a + 1 ; b <= n ; b ++ ) { for ( int c = b + 1 ; c <= n ; c ++ ) { if ( a * b + b * c + c * a == n ) return false ; } } } return true ; } public static void Main ( ) { int N = 10 ; if ( isIdoneal ( N ) ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } }

Accumulator variables: a, b, c
Iterator variables: a, b, c
Class/struct names: GFG
C# program:
using System ; class GFG { static bool checkDivisibility ( int n , int digit ) { return ( digit != 0 && n % digit == 0 ) ; } static bool isAllDigitsDivide ( int n ) { int temp = n ; while ( temp > 0 ) { int digit = temp % 10 ; if ( ! ( checkDivisibility ( n , digit ) ) ) return false ; temp /= 10 ; } return true ; } static bool isAllDigitsDistinct ( int n ) { bool [ ] arr = new bool [ 10 ] ; while ( n > 0 ) { int digit = n % 10 ; if ( arr [ digit ] ) return false ; arr [ digit ] = true ; n = n / 10 ; } return true ; } static bool isLynchBell ( int n ) { return isAllDigitsDivide ( n ) && isAllDigitsDistinct ( n ) ; } public static void Main ( ) { int N = 12 ; if ( isLynchBell ( N ) ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } }

Index/key variables: digit
Accumulator variables: temp
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isRepunitNum ( int n , int b ) { int length = 0 ; int countOne = 0 ; while ( n != 0 ) { int r = n % b ; length ++ ; if ( r == 1 ) countOne ++ ; n = n / b ; } return countOne >= 3 && countOne == length ; } public static void Main ( ) { int n = 31 ; int base1 = 2 ; if ( isRepunitNum ( n , base1 ) ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } }

Accumulator variables: countOne, length
Class/struct names: GFG
C# program:
using System ; class GFG { static int firstDigit ( int n ) { int digits = ( int ) ( Math . Log ( n ) / Math . Log ( 10 ) ) ; n = ( int ) ( n / Math . Pow ( 10 , digits ) ) ; return n ; } static int lastDigit ( int n ) { return ( n % 10 ) ; } static bool isGapful ( int n ) { int first_dig = firstDigit ( n ) ; int last_dig = lastDigit ( n ) ; int concatenation = first_dig * 10 + last_dig ; return ( n % concatenation == 0 ) ; } public static void Main ( ) { int n = 108 ; if ( isGapful ( n ) ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } }

Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int MAX = 10000 ; static List < int > primes = new List < int > ( ) ; static void sieveSundaram ( ) { bool [ ] marked = new bool [ MAX / 2 + 1 ] ; for ( int i = 1 ; i <= ( Math . Sqrt ( MAX ) - 1 ) / 2 ; i ++ ) for ( int j = ( i * ( i + 1 ) ) << 1 ; j <= MAX / 2 ; j = j + 2 * i + 1 ) marked [ j ] = true ; primes . Add ( 2 ) ; for ( int i = 1 ; i <= MAX / 2 ; i ++ ) if ( marked [ i ] == false ) primes . Add ( 2 * i + 1 ) ; } static bool isEconomical ( int n ) { if ( n == 1 ) return false ; int original_no = n ; int sumDigits = 0 ; while ( original_no > 0 ) { sumDigits ++ ; original_no = original_no / 10 ; } int pDigit = 0 , count_exp = 0 , p = 0 ; for ( int i = 0 ; primes [ i ] <= n / 2 ; i ++ ) { while ( n % primes [ i ] == 0 ) { p = primes [ i ] ; n = n / p ; count_exp ++ ; } while ( p > 0 ) { pDigit ++ ; p = p / 10 ; } while ( count_exp > 1 ) { pDigit ++ ; count_exp = count_exp / 10 ; } } if ( n != 1 ) { while ( n > 0 ) { pDigit ++ ; n = n / 10 ; } } return ( pDigit < sumDigits ) ; } public static void Main ( String [ ] args ) { sieveSundaram ( ) ; for ( int i = 1 ; i < 200 ; i ++ ) if ( isEconomical ( i ) ) Console . Write ( i + " ▁ " ) ; } }

Index/key variables: i, j
Accumulator variables: count_exp, i, pDigit, sumDigits
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isPossible ( int A , int B , int N , int K , int L ) { int needa , needb ; if ( A % K == 0 ) needa = A / K ; else needa = A / K + 1 ; if ( B % L == 0 ) needb = B / L ; else needb = B / L + 1 ; int total = needa + needb ; if ( total > N ) return false ; else return true ; } public static void Main ( String [ ] args ) { int A = 3 , B = 3 , N = 3 ; int K = 4 , M = 2 ; if ( isPossible ( A , B , N , K , M ) ) Console . Write ( " YES " + " STRNEWLINE " ) ; else Console . Write ( " NO " + " STRNEWLINE " ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { const int MAX = 1000050 ; static int [ ] spf = new int [ MAX + 1 ] ; static void calculate_SPF ( ) { for ( int i = 0 ; i <= MAX ; i ++ ) spf [ i ] = i ; for ( int i = 4 ; i <= MAX ; i += 2 ) spf [ i ] = 2 ; for ( int i = 3 ; i * i <= MAX ; i ++ ) { if ( spf [ i ] == i ) { for ( int j = i * i ; j <= MAX ; j += i ) if ( spf [ j ] == j ) spf [ j ] = i ; } } } static int [ ] tfactor = new int [ MAX + 1 ] ; static int [ ] pre = new int [ MAX + 1 ] ; static void CountTotalfactors ( ) { tfactor [ 1 ] = pre [ 1 ] = 1 ; for ( int i = 2 ; i <= MAX ; i ++ ) { int mspf = spf [ i ] ; int prim = mspf ; int temp = i ; int cnt = 0 ; while ( temp % mspf == 0 ) { temp /= mspf ; cnt += 1 ; prim = prim * mspf ; } tfactor [ i ] = ( cnt + 1 ) * tfactor [ temp ] ; pre [ i ] = pre [ i - 1 ] + tfactor [ i ] ; } } static int BinarySearch ( int X ) { int start = 1 ; int end = MAX - 1 ; while ( start < end ) { int mid = ( start + end ) / 2 ; if ( pre [ mid ] == X ) return mid ; else if ( pre [ mid ] < X ) start = mid + 1 ; else end = mid ; } return start ; } static void findSumOfCount ( int X ) { calculate_SPF ( ) ; CountTotalfactors ( ) ; Console . Write ( BinarySearch ( X ) + " STRNEWLINE " ) ; } public static void Main ( ) { int X = 10 ; findSumOfCount ( X ) ; } }

Index/key variables: i, j, mid, temp
Accumulator variables: cnt, i, j, temp
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static bool [ ] prime ; static void buildSieve ( int sum ) { prime = new bool [ sum + 1 ] ; for ( int i = 0 ; i < prime . Length ; i ++ ) prime [ i ] = true ; prime [ 0 ] = false ; prime [ 1 ] = false ; for ( int p = 2 ; p * p < ( sum + 1 ) ; p ++ ) { if ( prime [ p ] == true ) { for ( int i = p * 2 ; i < ( sum + 1 ) ; i += p ) prime [ i ] = false ; } } } static int getSum ( int [ , ] a ) { int s = 0 ; for ( int i = 0 ; i < 4 ; i ++ ) for ( int j = 0 ; j < 5 ; j ++ ) s += a [ i , j ] ; return s ; } static bool checkIndex ( int n , int m , int [ , ] a ) { for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < m ; j ++ ) { if ( prime [ i + j ] && ! prime [ a [ i , j ] ] ) { return false ; } } } return true ; } public static void Main ( String [ ] args ) { int n = 4 , m = 5 ; int [ , ] a = { { 1 , 2 , 3 , 2 , 2 } , { 2 , 2 , 7 , 7 , 7 } , { 7 , 7 , 21 , 7 , 10 } , { 2 , 2 , 3 , 6 , 7 } } ; int sum = getSum ( a ) ; buildSieve ( sum ) ; if ( prime [ sum ] && checkIndex ( n , m , a ) ) { Console . Write ( " YES " + " STRNEWLINE " ) ; } else Console . Write ( " NO " + " STRNEWLINE " ) ; } }

Index/key variables: i, p, sum
Accumulator variables: i, j, p, s
Iterator variables: i, j, p
Class/struct names: GFG
C# program:
using System ; class GFG { static void gaussEaster ( int Y ) { float A , B , C , P , Q , M , N , D , E ; A = Y % 19 ; B = Y % 4 ; C = Y % 7 ; P = ( float ) ( Y / 100 ) ; Q = ( float ) ( ( 13 + 8 * P ) / 25 ) ; M = ( 15 - Q + P - P / 4 ) % 30 ; N = ( 4 + P - P / 4 ) % 7 ; D = ( 19 * A + M ) % 30 ; E = ( 2 * B + 4 * C + 6 * D + N ) % 7 ; int days = ( int ) ( 22 + D + E ) ; if ( ( D == 29 ) && ( E == 6 ) ) { Console . Write ( Y + " - 04" + " - 19" ) ; return ; } else if ( ( D == 28 ) && ( E == 6 ) ) { Console . Write ( Y + " - 04" + " - 18" ) ; return ; } else { if ( days > 31 ) { Console . Write ( Y + " - 04 - " + ( days - 31 ) ) ; return ; } else { Console . Write ( Y + " - 03 - " + days ) ; return ; } } } public static void Main ( string [ ] args ) { int Y = 2020 ; gaussEaster ( Y ) ; } }

Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static List < List < int > > lis = new List < List < int > > ( ) ; static List < int > primes = new List < int > ( ) ; static int [ ] vis = new int [ 100001 ] ; static int [ ] dis = new int [ 100001 ] ; static bool isPrime ( int n ) { int i = 2 ; while ( i * i <= n ) { if ( n % i == 0 ) return false ; i += 1 ; } return true ; } static bool valid ( int a , int b ) { int c = 0 ; while ( a > 0 ) { if ( ( a % 10 ) != ( b % 10 ) ) c += 1 ; a = a / 10 ; b = b / 10 ; } if ( c == 1 ) return true ; else return false ; } static void makePrimes ( int N ) { int L = ( int ) Math . Pow ( 10 , N - 1 ) ; int R = ( int ) Math . Pow ( 10 , N ) - 1 ; for ( int i = L ; i < R + 1 ; i ++ ) { if ( isPrime ( i ) ) primes . Add ( i ) ; } for ( int i = 0 ; i < primes . Count ; i ++ ) { for ( int j = i + 1 ; j < primes . Count ; j ++ ) { int a = primes [ i ] ; int b = primes [ j ] ; if ( valid ( a , b ) ) { lis [ a ] . Add ( b ) ; lis [ b ] . Add ( a ) ; } } } } static void bfs ( int src ) { List < int > q = new List < int > ( ) ; q . Add ( src ) ; vis [ src ] = 1 ; dis [ src ] = 0 ; while ( q . Count != 0 ) { int curr = q [ 0 ] ; q . RemoveAt ( 0 ) ; foreach ( int x in lis [ curr ] ) { if ( vis [ x ] == 0 ) { vis [ x ] = 1 ; q . Add ( x ) ; dis [ x ] = dis [ curr ] + 1 ; } } } } static void Main ( ) { for ( int i = 0 ; i < 100001 ; i ++ ) { lis . Add ( new List < int > ( ) ) ; } int N = 4 ; makePrimes ( N ) ; int A = 1033 ; int B = 8179 ; bfs ( A ) ; if ( dis [ B ] == - 1 ) { Console . Write ( - 1 ) ; } else { Console . Write ( dis [ B ] ) ; } } }

Index/key variables: B, a, b, curr, i, j, src, x
Accumulator variables: c, i, j
Iterator variables: i, j, x
Class/struct names: GFG
C# program:
using System ; class GFG { static int placeValue ( int N , int num ) { int total = 1 , value = 0 , rem = 0 ; while ( true ) { rem = N % 10 ; N = N / 10 ; if ( rem == num ) { value = total * rem ; break ; } total = total * 10 ; } return value ; } public static void Main ( ) { int D = 5 ; int N = 85932 ; Console . Write ( placeValue ( N , D ) ) ; } }

Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static List < int > findDivisors ( int n ) { List < int > divisors = new List < int > ( ) ; for ( int i = 1 ; i < ( Math . Sqrt ( n ) + 1 ) ; i ++ ) { if ( n % i == 0 ) { if ( n / i == i ) divisors . Add ( i ) ; else { divisors . Add ( i ) ; divisors . Add ( ( n / i ) ) ; } } } divisors . Sort ( ) ; return divisors ; } static bool isSuperdNum ( int n ) { List < int > d = findDivisors ( n ) ; foreach ( int i in d ) { double x = ( Math . Pow ( 2 , i ) - 2 ) / i ; if ( Math . Truncate ( x ) != x ) return false ; } return true ; } public static void Main ( string [ ] args ) { int n = 341 ; if ( isSuperdNum ( n ) == true ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void BeattySequence ( int n ) { for ( int i = 1 ; i <= n ; i ++ ) { double ans = Math . Floor ( i * Math . Sqrt ( 2 ) ) ; Console . Write ( ans + " , ▁ " ) ; } } public static void Main ( ) { int n = 5 ; BeattySequence ( n ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int getSum ( int n ) { int sum = 0 ; for ( int i = 1 ; i <= Math . Sqrt ( n ) ; i ++ ) { if ( n % i == 0 ) { if ( n / i == i ) sum = sum + i ; else { sum = sum + i ; sum = sum + ( n / i ) ; } } } return sum ; } static bool checkAbundant ( int n ) { return ( getSum ( n ) - n > n ) ; } static bool isDeficient ( int n ) { return ( getSum ( n ) < ( 2 * n ) ) ; } static bool checkPrimitiveAbundant ( int num ) { if ( ! checkAbundant ( num ) ) { return false ; } for ( int i = 2 ; i <= Math . Sqrt ( num ) ; i ++ ) { if ( num % i == 0 && i != num ) { if ( i * i == num ) { if ( ! isDeficient ( i ) ) { return false ; } } else if ( ! isDeficient ( i ) || ! isDeficient ( num / i ) ) { return false ; } } } return true ; } public static void Main ( ) { int n = 20 ; if ( checkPrimitiveAbundant ( n ) ) { Console . Write ( " Yes " ) ; } else { Console . Write ( " No " ) ; } } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int calculateSum ( int N ) { return N * ( N - 1 ) / 2 + N * ( N - 1 ) * ( 2 * N - 1 ) / 6 ; } public static void Main ( ) { int N = 3 ; Console . Write ( calculateSum ( N ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int divSum ( int num ) { int result = 0 ; for ( int i = 1 ; i <= Math . Sqrt ( num ) ; i ++ ) { if ( num % i == 0 ) { if ( i == ( num / i ) ) result += i ; else result += ( i + num / i ) ; } } return ( result - 1 - num ) ; } static int getSum ( int n ) { int sum = 0 ; while ( n != 0 ) { int r = n % 10 ; sum = sum + r * r ; n = n / 10 ; } return sum ; } static bool isCanada ( int n ) { return divSum ( n ) == getSum ( n ) ; } public static void Main ( ) { int n = 125 ; if ( isCanada ( n ) ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } }

Accumulator variables: i, result
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int getSum ( int n ) { int sum = 0 ; while ( n != 0 ) { sum = sum + n % 10 ; n = n / 10 ; } return sum ; } static bool isSelfNum ( int n ) { for ( int m = 1 ; m <= n ; m ++ ) { if ( m + getSum ( m ) == n ) return false ; } return true ; } public static void Main ( ) { int n = 20 ; if ( isSelfNum ( n ) ) { Console . Write ( " Yes " ) ; } else { Console . Write ( " No " ) ; } } }

Accumulator variables: m
Iterator variables: m
Class/struct names: GFG
C# program:
using System ; 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 ] ; } public static void Main ( ) { int n = 3 ; int k = n ; n = 2 * n ; Console . Write ( binomialCoeff ( n , k ) ) ; } }

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