dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; using System . Collections . Generic ; class GFG { public static List < int > getRow ( int rowIndex ) { List < int > currow = new List < int > ( ) ; currow . Add ( 1 ) ; if ( rowIndex == 0 ) { return currow ; } List < int > prev = getRow ( rowIndex - 1 ) ; for ( int i = 1 ; i < prev . Count ; i ++ ) { int curr = prev [ i - 1 ] + prev [ i ] ; currow . Add ( curr ) ; } currow . Add ( 1 ) ; return currow ; } public static void Main ( String [ ] args ) { int n = 3 ; List < int > arr = getRow ( n ) ; for ( int i = 0 ; i < arr . Count ; i ++ ) { if ( i == arr . Count - 1 ) Console . Write ( arr [ i ] ) ; else Console . Write ( arr [ i ] + " , ▁ " ) ; } } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void allQuotients ( int N ) { SortedSet < int > s = new SortedSet < int > ( ) ; for ( int k = 1 ; k <= N + 1 ; k ++ ) { s . Add ( N / k ) ; } foreach ( int it in s ) { Console . Write ( it + " ▁ " ) ; } } static void Main ( ) { int N = 5 ; allQuotients ( N ) ; } }

Accumulator variables: k
Iterator variables: it, k
Class/struct names: GFG
C# program:
using System ; class GFG { public static int greatestOddFactor ( int n ) { int pow_2 = ( int ) ( Math . Log ( n ) ) ; int i = 1 ; while ( i <= pow_2 ) { int fac_2 = ( 2 * i ) ; if ( n % fac_2 == 0 ) { if ( ( n / fac_2 ) % 2 == 1 ) { return ( n / fac_2 ) ; } } i += 1 ; } return 0 ; } public static void Main ( String [ ] args ) { int N = 8642 ; Console . WriteLine ( greatestOddFactor ( N ) ) ; } }

Accumulator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections ; using System . Collections . Generic ; class GFG { class node { public string i ; public node next = null ; } ; static node newnode ( string s ) { node temp = new node ( ) ; temp . i = s ; temp . next = null ; return temp ; } static string Majority_in_linklist ( node head ) { string s = " " ; string t = " " ; int p = 0 , q = 0 ; node ptr = null ; while ( head != null ) { if ( s . Equals ( head . i ) ) { p = p + 1 ; } else { if ( t . Equals ( head . i ) ) { q = q + 1 ; } else { if ( p == 0 ) { s = head . i ; p = 1 ; } else { if ( q == 0 ) { t = head . i ; q = 1 ; } else { p = p - 1 ; q = q - 1 ; } } } } head = head . next ; } head = ptr ; p = 0 ; q = 0 ; while ( head != null ) { if ( s . Equals ( head . i ) ) { p = 1 ; } else { if ( t . Equals ( head . i ) ) { q = 1 ; } } head = head . next ; } if ( p > q ) { return s ; } else { return t ; } } public static void Main ( string [ ] arg ) { node head = newnode ( " geeks " ) ; head . next = newnode ( " geeks " ) ; head . next . next = newnode ( " abcd " ) ; head . next . next . next = newnode ( " game " ) ; head . next . next . next . next = newnode ( " game " ) ; head . next . next . next . next . next = newnode ( " knight " ) ; head . next . next . next . next . next . next = newnode ( " harry " ) ; head . next . next . next . next . next . next . next = newnode ( " geeks " ) ; Console . Write ( Majority_in_linklist ( head ) ) ; } }

Class/struct names: GFG, node
C# program:
using System ; using System . Text ; class GFG { static String max_number ( int [ ] arr , int sum ) { int [ ] frac = new int [ 9 ] ; int maxi = int . MinValue ; StringBuilder ans = new StringBuilder ( ) ; int pos = 0 ; for ( int i = 0 ; i < 9 ; i ++ ) { frac [ i ] = sum / arr [ i ] ; if ( frac [ i ] > maxi ) { pos = i ; maxi = frac [ i ] ; } } for ( int i = 0 ; i < maxi ; i ++ ) { ans . Append ( ( char ) ( ( pos + 1 ) + '0' ) ) ; } sum -= maxi * arr [ pos ] ; for ( int i = 0 ; i < maxi ; i ++ ) { for ( int j = 1 ; j <= 9 ; j ++ ) { if ( sum + arr [ pos ] - arr [ j - 1 ] >= 0 ) { ans [ i ] = ( char ) ( j + '0' ) ; sum += arr [ pos ] - arr [ j - 1 ] ; break ; } } } if ( maxi == 0 ) { return "0" ; } else { return ans . ToString ( ) ; } } public static void Main ( String [ ] str ) { int [ ] arr = { 3 , 4 , 2 , 4 , 6 , 5 , 4 , 2 , 3 } ; int s = 13 ; Console . WriteLine ( max_number ( arr , s ) ) ; } }

Index/key variables: i, pos
Accumulator variables: i, j, sum
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static bool checkOverlapping ( List < int > a , List < int > b ) { if ( a [ 0 ] < b [ 0 ] ) { int temp = a [ 0 ] ; a [ 0 ] = b [ 0 ] ; b [ 0 ] = temp ; temp = a [ 1 ] ; a [ 1 ] = b [ 1 ] ; b [ 1 ] = temp ; } if ( b [ 0 ] <= a [ 0 ] && a [ 0 ] <= b [ 1 ] ) return true ; return false ; } static int find ( List < int > a , int i ) { if ( a [ i ] == i ) { return i ; } a [ i ] = find ( a , a [ i ] ) ; return a [ i ] ; } static bool union ( List < int > a , int x , int y ) { int xs = find ( a , x ) ; int ys = find ( a , y ) ; if ( xs == ys ) { return true ; } a [ ys ] = xs ; return false ; } static bool checkNonOverlapping ( List < List < int > > arr , int n ) { List < int > dsu = new List < int > ( ) ; for ( int i = 0 ; i < n + 1 ; i ++ ) { dsu . Add ( i ) ; } for ( int i = 0 ; i < n ; i ++ ) { for ( int j = i + 1 ; j < n ; j ++ ) { if ( checkOverlapping ( arr [ i ] , arr [ j ] ) ) { if ( union ( dsu , i , j ) ) { return false ; } } } } return true ; } static void Main ( ) { List < List < int > > arr = new List < List < int > > ( ) ; arr . Add ( new List < int > { 1 , 4 } ) ; arr . Add ( new List < int > { 2 , 2 } ) ; arr . Add ( new List < int > { 2 , 3 } ) ; int n = arr . Count ; if ( checkNonOverlapping ( arr , n ) ) { Console . WriteLine ( " YES " ) ; } else { Console . WriteLine ( " NO " ) ; } } }

Index/key variables: i, j, ys
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static void FindValue ( int N , int K ) { if ( N % 2 == 0 ) { N = N + 2 * K ; } else { int i ; for ( i = 2 ; i < Math . Sqrt ( N ) + 1 ; i ++ ) { if ( N % i == 0 ) break ; } N = N + i ; N = N + 2 * ( K - 1 ) ; } Console . WriteLine ( N ) ; } public static void Main ( ) { int N = 9 ; int K = 4 ; FindValue ( N , K ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int lastDigitFactorial ( int n ) { if ( n == 0 ) return 1 ; else if ( n <= 2 ) return n ; else if ( n == 3 ) return 6 ; else if ( n == 4 ) return 4 ; else return 0 ; } public static void Main ( string [ ] args ) { Console . Write ( lastDigitFactorial ( 6 ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { public static int heptadecagonal_num ( int n ) { return ( ( 15 * n * n ) - 13 * n ) / 2 ; } public static int sum_heptadecagonal_num ( int n ) { int summ = 0 ; for ( int i = 1 ; i < n + 1 ; i ++ ) { summ += heptadecagonal_num ( i ) ; } return summ ; } public static void Main ( ) { int n = 5 ; Console . WriteLine ( sum_heptadecagonal_num ( n ) ) ; } }

Accumulator variables: i, summ
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isCenteredpentagonal ( int N ) { float n = ( float ) ( ( 5 + Math . Sqrt ( 40 * N - 15 ) ) / 10 ) ; return ( n - ( int ) n ) == 0 ; } public static void Main ( string [ ] args ) { int N = 6 ; if ( isCenteredpentagonal ( N ) ) { Console . Write ( " Yes " ) ; } else { Console . Write ( " No " ) ; } } }

Class/struct names: GFG
C# program:
using System ; class GFG { static bool isdodecagonal ( int N ) { float n = ( float ) ( ( 4 + Math . Sqrt ( 20 * N + 16 ) ) / 10 ) ; return ( n - ( int ) n ) == 0 ; } public static void Main ( string [ ] args ) { int N = 12 ; if ( isdodecagonal ( N ) ) { Console . Write ( " Yes " ) ; } else { Console . Write ( " No " ) ; } } }

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 ; } public static void Main ( ) { int N = 7 ; int K = 2 ; Console . Write ( prevPowerofK ( N , K ) + " ▁ " ) ; Console . Write ( nextPowerOfK ( N , K ) ) ; } }

Class/struct names: GFG
C# program:
using System ; public class GFG { static int [ ] pref = new int [ 100001 ] ; static int isComposite ( int n ) { if ( n <= 1 ) return 0 ; if ( n <= 3 ) return 0 ; if ( n % 2 == 0 n % 3 == 0 ) return n ; for ( int i = 5 ; i * i <= n ; i = i + 6 ) if ( n % i == 0 || n % ( i + 2 ) == 0 ) return n ; return 0 ; } static void preCompute ( ) { for ( int i = 1 ; i <= 100000 ; ++ i ) { pref [ i ] = pref [ i - 1 ] + isComposite ( i ) ; } } static void printSum ( int L , int R ) { Console . Write ( pref [ R ] - pref [ L - 1 ] + " STRNEWLINE " ) ; } static void printSumComposite ( 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 } } ; printSumComposite ( arr , Q ) ; } }

Index/key variables: R, i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static float findProb ( int l , int r ) { float countOfPS = ( float ) ( Math . Floor ( Math . Sqrt ( r ) ) - Math . Ceiling ( Math . Sqrt ( l ) ) + 1 ) ; float total = r - l + 1 ; float prob = ( float ) countOfPS / ( float ) total ; return prob ; } public static void Main ( String [ ] args ) { int L = 16 , R = 25 ; Console . Write ( findProb ( L , R ) ) ; } }

Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int sumDigits ( int n ) { int sum = 0 ; while ( n != 0 ) { sum += n % 10 ; n /= 10 ; } return sum ; } static Dictionary < int , int > constDict ( int n ) { Dictionary < int , int > d = new Dictionary < int , int > ( ) ; for ( int i = 1 ; i < n + 1 ; ++ i ) { int sum1 = sumDigits ( i ) ; if ( ! d . ContainsKey ( sum1 ) ) d . Add ( sum1 , 1 ) ; else d [ sum1 ] += 1 ; } return d ; } static int countLargest ( int n ) { Dictionary < int , int > d = constDict ( n ) ; int size = 0 ; int count = 0 ; foreach ( KeyValuePair < int , int > it in d ) { int k = it . Key ; int val = it . Value ; if ( val > size ) { size = val ; count = 1 ; } else if ( val == size ) count += 1 ; } return count ; } static void Main ( ) { int n = 13 ; int group = countLargest ( n ) ; Console . WriteLine ( group ) ; } }

Index/key variables: sum1
Accumulator variables: count, n, sum
Iterator variables: i, it
Class/struct names: GFG
C# program:
using System ; class GFG { static long findDigits ( int n , int b ) { if ( n < 0 ) return 0 ; if ( n <= 1 ) return 1 ; double M_PI = 3.141592 ; double M_E = 2.7182 ; double x = ( ( n * Math . Log10 ( n / M_E ) + Math . Log10 ( 2 * M_PI * n ) / 2.0 ) ) / ( Math . Log10 ( b ) ) ; return ( long ) ( Math . Floor ( x ) + 1 ) ; } public static void Main ( string [ ] args ) { Console . WriteLine ( findDigits ( 4 , 16 ) ) ; Console . WriteLine ( findDigits ( 5 , 8 ) ) ; Console . WriteLine ( findDigits ( 12 , 16 ) ) ; Console . WriteLine ( findDigits ( 19 , 13 ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static long [ ] pref = new long [ 100010 ] ; static bool isPerfectSquare ( int x ) { int s = ( int ) Math . Sqrt ( x ) ; return ( s * s == x ) ; } static int isNonFibonacci ( int n ) { if ( isPerfectSquare ( 5 * n * n + 4 ) || isPerfectSquare ( 5 * n * n - 4 ) ) return 0 ; else return n ; } static void compute ( ) { for ( int i = 1 ; i <= 100000 ; ++ i ) { pref [ i ] = pref [ i - 1 ] + isNonFibonacci ( i ) ; } } static void printSum ( int L , int R ) { int sum = ( int ) ( pref [ R ] - pref [ L - 1 ] ) ; Console . Write ( sum + " ▁ " ) ; } public static void Main ( String [ ] args ) { compute ( ) ; int Q = 2 ; int [ , ] arr = { { 1 , 5 } , { 6 , 10 } } ; 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 bool isPrime ( int n ) { if ( n <= 1 ) return false ; if ( n <= 3 ) return true ; if ( n % 2 == 0 n % 3 == 0 ) return false ; for ( int i = 5 ; i * i <= n ; i += 6 ) { if ( n % i == 0 || n % ( i + 2 ) == 0 ) { return false ; } } return true ; } static bool twinPrime ( int n1 , int n2 ) { return ( isPrime ( n1 ) && isPrime ( n2 ) && Math . Abs ( n1 - n2 ) == 2 ) ; } static int countTwinPairs ( int [ ] arr , int n ) { int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = i + 1 ; j < n ; j ++ ) { if ( twinPrime ( arr [ i ] , arr [ j ] ) ) { count ++ ; } } } return count ; } public static void Main ( String [ ] args ) { int [ ] arr = { 2 , 3 , 5 , 11 } ; int n = arr . Length ; Console . Write ( countTwinPairs ( arr , n ) ) ; } }

Index/key variables: i, j
Accumulator variables: count, i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void solve ( int [ ] arr , int n ) { HashSet < int > unfilled_indices = new HashSet < int > ( ) ; HashSet < int > missing = new HashSet < int > ( ) ; for ( int i = 1 ; i < n ; i ++ ) { missing . Add ( i ) ; } for ( int i = 1 ; i < n ; i ++ ) { if ( arr [ i ] == 0 ) { unfilled_indices . Add ( i ) ; } else { missing . Remove ( arr [ i ] ) ; } } int [ ] mi = new int [ missing . Count ] ; int l = 0 ; foreach ( int x in missing ) { mi [ l ++ ] = x ; } int m = missing . Count ; foreach ( int it in unfilled_indices ) { arr [ it ] = mi [ m - 1 ] ; m -- ; } int pos = 0 ; for ( int i = 1 ; i < n ; i ++ ) { if ( arr [ i ] == i ) { pos = i ; } } if ( pos != 0 ) { for ( int i = 1 ; i < n ; i ++ ) { if ( pos != i ) { if ( unfilled_indices . Contains ( i ) ) { int x = arr [ i ] ; arr [ i ] = pos ; arr [ pos ] = x ; break ; } } } } printArray ( arr , n ) ; } static void printArray ( int [ ] arr , int n ) { for ( int i = 1 ; i < n ; i ++ ) { Console . Write ( arr [ i ] + " ▁ " ) ; } } static public void Main ( ) { int [ ] arr = { 0 , 7 , 4 , 0 , 3 , 0 , 5 , 1 } ; int n = arr . Length ; solve ( arr , n ) ; } }

Index/key variables: i, it, pos
Accumulator variables: i, l, m
Iterator variables: i, it, x
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static bool check ( int x , List < int > pos , List < int > neg , int k ) { int pairs = 0 ; int p = neg . Count - 1 ; int nn = neg . Count - 1 ; int pp = pos . Count - 1 ; for ( int i = 0 ; i < neg . Count ; i ++ ) { while ( ( p >= 0 ) && ( ( int ) neg [ i ] * ( int ) neg [ p ] <= x ) ) p -- ; pairs += Math . Min ( nn - p , nn - i ) ; } p = 0 ; for ( int i = pos . Count - 1 ; i >= 0 ; i -- ) { while ( ( p < pos . Count ) && ( ( int ) pos [ i ] * ( int ) pos [ p ] <= x ) ) p ++ ; pairs += Math . Min ( p , i ) ; } p = pos . Count - 1 ; for ( int i = neg . Count - 1 ; i >= 0 ; i -- ) { while ( ( p >= 0 ) && ( ( int ) neg [ i ] * ( int ) pos [ p ] <= x ) ) p -- ; pairs += pp - p ; } return ( pairs >= k ) ; } static int kth_element ( int [ ] a , int n , int k ) { List < int > pos = new List < int > ( ) ; List < int > neg = new List < int > ( ) ; ; for ( int i = 0 ; i < n ; i ++ ) { if ( a [ i ] >= 0 ) pos . Add ( a [ i ] ) ; else neg . Add ( a [ i ] ) ; } sort ( pos . begin ( ) , pos . end ( ) ) ; sort ( neg . begin ( ) , neg . end ( ) ) ; pos . Sort ( ) ; neg . Sort ( ) ; int l = ( int ) - 1e8 , ans = 0 , r = ( int ) 1e8 ; while ( l <= r ) { int mid = ( l + r ) >> 1 ; if ( check ( mid , pos , neg , k ) ) { ans = mid ; r = mid - 1 ; } else l = mid + 1 ; } return ans ; } public static void Main ( String [ ] args ) { int [ ] a = { - 4 , - 2 , 3 , 3 } ; int k = 3 ; int n = a . Length ; Console . WriteLine ( kth_element ( a , n , k ) ) ; } }

Index/key variables: i, p
Accumulator variables: i, p, pairs
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static double squareRoot ( double n , double l ) { double x = n ; double root ; int count = 0 ; while ( true ) { count ++ ; root = 0.5 * ( x + ( n / x ) ) ; if ( Math . Abs ( root - x ) < l ) break ; x = root ; } return root ; } public static void Main ( ) { double n = 327 ; double l = 0.00001 ; Console . WriteLine ( squareRoot ( n , l ) ) ; } }

Accumulator variables: count
Class/struct names: GFG
C# program:
using System ; class GFG { static int MAX = 100000 ; static int [ ] sequence = new int [ MAX + 1 ] ; static void vanEckSequence ( ) { for ( int i = 0 ; i < MAX ; i ++ ) { sequence [ i ] = 0 ; } for ( int i = 0 ; i < MAX ; i ++ ) { for ( int j = i - 1 ; j >= 0 ; j -- ) { if ( sequence [ j ] == sequence [ i ] ) { sequence [ i + 1 ] = i - j ; break ; } } } } static int getCount ( int n ) { int nthTerm = sequence [ n - 1 ] ; int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( sequence [ i ] == nthTerm ) count ++ ; } return count ; } public static void Main ( ) { vanEckSequence ( ) ; int n = 5 ; Console . WriteLine ( getCount ( n ) ) ; n = 11 ; Console . WriteLine ( getCount ( n ) ) ; } }

Index/key variables: i, j
Accumulator variables: count, i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int MAX = 100000 ; static int [ ] sequence = new int [ MAX + 1 ] ; static void vanEckSequence ( ) { for ( int i = 0 ; i < MAX ; i ++ ) { sequence [ i ] = 0 ; } for ( int i = 0 ; i < MAX ; i ++ ) { for ( int j = i - 1 ; j >= 0 ; j -- ) { if ( sequence [ j ] == sequence [ i ] ) { sequence [ i + 1 ] = i - j ; break ; } } } } static int getCount ( int n ) { int count = 1 ; int i = n - 1 ; while ( sequence [ i + 1 ] != 0 ) { count ++ ; i = i - sequence [ i + 1 ] ; } return count ; } public static void Main ( string [ ] args ) { vanEckSequence ( ) ; int n = 5 ; Console . WriteLine ( getCount ( n ) ) ; n = 11 ; Console . WriteLine ( getCount ( n ) ) ; } }

Index/key variables: i, j
Accumulator variables: count, i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static void remainingTime ( int h , int m ) { int totalMin , hoursRemaining , minRemaining ; totalMin = 1440 - 60 * h - m ; hoursRemaining = totalMin / 60 ; minRemaining = totalMin % 60 ; Console . WriteLine ( hoursRemaining + " : : " + minRemaining ) ; } public static void Main ( ) { int h = 0 , m = 1 ; remainingTime ( h , m ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void check ( int n ) { if ( n % 2 == 1 && n > 5 ) { Console . Write ( " YES " ) ; } else { Console . WriteLine ( " NO " ) ; } } public static void Main ( String [ ] args ) { int a = 3 ; int b = 7 ; check ( a ) ; check ( b ) ; } }

Class/struct names: GFG
C# program:
using System . Collections . Generic ; using System ; class GFG { static long [ ] factorial = new long [ 1000005 ] ; static long [ ] modinverse = new long [ 1000005 ] ; static long mod = 1000000007 ; static int N = 1000005 ; static long power ( long a , long m1 ) { if ( m1 == 0 ) return 1 ; else if ( m1 == 1 ) return a ; else if ( m1 == 2 ) return ( a * a ) % mod ; else if ( ( m1 & 1 ) != 0 ) return ( a * power ( power ( a , m1 / 2 ) , 2 ) ) % mod ; else return power ( power ( a , m1 / 2 ) , 2 ) % mod ; } static void factorialfun ( ) { factorial [ 0 ] = 1 ; for ( int i = 1 ; i < N ; i ++ ) factorial [ i ] = ( factorial [ i - 1 ] * i ) % mod ; } static void modinversefun ( ) { modinverse [ N - 1 ] = power ( factorial [ N - 1 ] , mod - 2 ) % mod ; for ( int i = N - 2 ; i >= 0 ; i -- ) modinverse [ i ] = ( modinverse [ i + 1 ] * ( i + 1 ) ) % mod ; } static long binomial ( int n , int r ) { if ( r > n ) return 0 ; long a = ( factorial [ n ] * modinverse [ n - r ] ) % mod ; a = ( a * modinverse [ r ] ) % mod ; return a ; } static long ways ( long x , long y ) { factorialfun ( ) ; modinversefun ( ) ; if ( ( 2 * x - y ) % 3 == 0 && ( 2 * y - x ) % 3 == 0 ) { long m = ( 2 * x - y ) / 3 ; long n = ( 2 * y - x ) / 3 ; System . out . println ( n + m + " ▁ " + n ) ; return binomial ( ( int ) ( n + m ) , ( int ) n ) ; } return 0 ; } public static void Main ( ) { long x = 3 , y = 3 ; Console . WriteLine ( ways ( x , y ) ) ; } }

Index/key variables: i, n, r
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static String solve ( int n , char x , char y ) { int length = ( int ) Math . Ceiling ( Math . Log ( n + 2 ) / Math . Log ( 2 ) ) - 1 ; int rank = n - ( 1 << length ) + 1 ; String left = " " , right = " " ; for ( int i = length - 1 ; i >= 0 ; i -- ) { int mask = ( 1 << i ) ; int bit = mask & rank ; if ( bit > 0 ) { left += y ; right += y ; } else { left += x ; right += x ; } } right = reverse ( right ) ; String res = left + right ; return res ; } static String reverse ( String input ) { char [ ] a = input . ToCharArray ( ) ; int l , r = 0 ; r = a . Length - 1 ; for ( l = 0 ; l < r ; l ++ , r -- ) { char temp = a [ l ] ; a [ l ] = a [ r ] ; a [ r ] = temp ; } return String . Join ( " " , a ) ; } public static void Main ( String [ ] args ) { int n = 23 ; char x = '4' , y = '5' ; String ans = solve ( n , x , y ) ; Console . WriteLine ( ans ) ; } }

Index/key variables: l, r
Accumulator variables: i, l, left, r, right
Iterator variables: i, l
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 ] ; } static int findMax ( int n ) { return binomialCoeff ( n , n / 2 ) ; } public static void Main ( ) { int n = 5 ; Console . WriteLine ( findMax ( n ) ) ; } }

Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; 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 ) ; Console . Write ( ( a / gcd ) + " ▁ " + ( b / gcd ) ) ; } static public void Main ( ) { int a = 12 , b = 16 ; findNumbers ( a , b ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void findBalance ( int x , float bal ) { if ( x % 10 == 0 && ( ( float ) x + 1.50 ) <= bal ) { Console . Write ( " { 0 : F2 } STRNEWLINE " , bal - x - 1.50 ) ; } else { Console . Write ( " { 0 : F2 } STRNEWLINE " , bal ) ; } } public static void Main ( String [ ] args ) { int x = 50 ; float bal = ( float ) 100.50 ; findBalance ( x , bal ) ; } }

Class/struct names: GFG
C# program:
using System ; 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 ; Console . WriteLine ( countKdivPairs ( A , n , K ) ) ; } }

Index/key variables: K, i, rem
Accumulator variables: ans, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void min_visible_bottles ( int [ ] arr , int n ) { Dictionary < int , int > mp = new Dictionary < int , int > ( ) ; int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( mp . ContainsKey ( arr [ i ] ) ) { mp [ arr [ i ] ] = mp [ arr [ i ] ] + 1 ; } else { mp . Add ( arr [ i ] , 1 ) ; } ans = Math . Max ( ans , mp [ arr [ i ] ] ) ; } Console . Write ( " Minimum ▁ number ▁ of ▁ " + " Visible ▁ Bottles ▁ are : ▁ " + ans + " STRNEWLINE " ) ; } 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