dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
class GFG { static long mod = 1000000007 ; static long [ ] arr = new long [ 1000001 ] ; static void cal_factorial ( ) { arr [ 0 ] = 1 ; for ( long i = 1 ; i <= 1000000 ; i ++ ) { arr [ i ] = ( arr [ i - 1 ] * i ) % mod ; } } static long mod_exponent ( long num , long p ) { if ( p == 0 ) return 1 ; if ( ( p & 1 ) != 0 ) { return ( ( num % mod ) * ( mod_exponent ( ( num * num ) % mod , p / 2 ) ) % mod ) % mod ; } else return ( mod_exponent ( ( num * num ) % mod , p / 2 ) ) % mod ; } static long getCount ( long x , long y ) { long ans = arr [ x + y - 1 ] ; ans *= mod_exponent ( arr [ x ] , mod - 2 ) ; ans %= mod ; ans *= mod_exponent ( arr [ y ] , mod - 2 ) ; ans %= mod ; ans *= ( x - y ) ; ans %= mod ; return ans ; } static void Main ( ) { cal_factorial ( ) ; long x = 3 , y = 1 ; System . Console . WriteLine ( getCount ( x , y ) ) ; } }

Index/key variables: i, x, y
Accumulator variables: ans, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void findValues ( int a , int b ) { if ( ( a - b ) % 2 == 1 ) { Console . Write ( " - 1" ) ; return ; } Console . WriteLine ( ( ( a - b ) / 2 ) + " ▁ " + ( ( a + b ) / 2 ) ) ; } static public void Main ( ) { int a = 12 , b = 8 ; findValues ( a , b ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { class Data { public double x , y ; public Data ( double x , double y ) { this . x = x ; this . y = y ; } } ; static double inv_interpolate ( Data [ ] d , int n , double y ) { double x = 0 ; int i , j ; for ( i = 0 ; i < n ; i ++ ) { double xi = d [ i ] . x ; for ( j = 0 ; j < n ; j ++ ) { if ( j != i ) { xi = xi * ( y - d [ j ] . y ) / ( d [ i ] . y - d [ j ] . y ) ; } } x += xi ; } return x ; } public static void Main ( String [ ] args ) { Data [ ] d = { new Data ( 1.27 , 2.3 ) , new Data ( 2.25 , 2.95 ) , new Data ( 2.5 , 3.5 ) , new Data ( 3.6 , 5.1 ) } ; int n = 4 ; double y = 4.5 ; Console . Write ( " Value ▁ of ▁ x ▁ at ▁ y ▁ = ▁ 4.5 ▁ : ▁ { 0 : f5 } " , inv_interpolate ( d , n , y ) ) ; } }

Index/key variables: i, j
Accumulator variables: i, j, x
Iterator variables: i, j
Class/struct names: Data, GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { public class pair { public int first , second ; public pair ( int first , int second ) { this . first = first ; this . second = second ; } } static int countTriplets ( int n , List < pair > points ) { HashSet < pair > pts = new HashSet < pair > ( ) ; int ct = 0 ; for ( int i = 0 ; i < n ; i ++ ) pts . Add ( points [ i ] ) ; for ( int i = 0 ; i < n ; i ++ ) for ( int j = i + 1 ; j < n ; j ++ ) { int x = points [ i ] . first + points [ j ] . first ; int y = points [ i ] . second + points [ j ] . second ; if ( x % 2 == 0 && y % 2 == 0 ) if ( ! pts . Contains ( new pair ( x / 2 , y / 2 ) ) ) ct ++ ; } return ct ; } public static void Main ( String [ ] args ) { List < pair > points = new List < pair > ( ) ; points . Add ( new pair ( 1 , 1 ) ) ; points . Add ( new pair ( 2 , 2 ) ) ; points . Add ( new pair ( 3 , 3 ) ) ; int n = points . Count ; Console . WriteLine ( countTriplets ( n , points ) ) ; } }

Index/key variables: i, j
Accumulator variables: ct, i, j
Iterator variables: i, j
Class/struct names: GFG, pair
C# program:
using System ; class GFG { static double mixtureConcentration ( int n , int [ ] p ) { double res = 0 ; for ( int i = 0 ; i < n ; i ++ ) res += p [ i ] ; res /= n ; return Math . Round ( res , 4 ) ; } static void Main ( ) { int [ ] arr = { 0 , 20 , 20 } ; int n = arr . Length ; Console . WriteLine ( mixtureConcentration ( n , arr ) ) ; } }

Index/key variables: i
Accumulator variables: i, res
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static long MAX = ( long ) ( 1E5 + 5 ) ; static long MOD = ( long ) ( 1E9 + 7 ) ; static bool check ( long num , long a , long b ) { while ( num > 0 ) { long rem = num % 10 ; num /= 10 ; if ( rem != a && rem != b ) return false ; } return true ; } static long power ( long x , long y ) { long ans = 1 ; while ( y > 0 ) { if ( ( y & 1 ) > 0 ) ans = ( ans * x ) % MOD ; y >>= 1 ; x = ( x * x ) % MOD ; } return ans % MOD ; } static long modInverse ( long x ) { return power ( x , MOD - 2 ) ; } static long countNumbers ( long n , long a , long b ) { long [ ] fact = new long [ MAX ] ; long [ ] inv = new long [ MAX ] ; long ans = 0 ; fact [ 0 ] = 1 ; for ( long i = 1 ; i < MAX ; i ++ ) { fact [ i ] = ( 1 * fact [ i - 1 ] * i ) ; fact [ i ] %= MOD ; } inv [ MAX - 1 ] = modInverse ( fact [ MAX - 1 ] ) ; for ( long i = MAX - 2 ; i >= 0 ; i -- ) { inv [ i ] = ( inv [ i + 1 ] * ( i + 1 ) ) ; inv [ i ] %= MOD ; } if ( a < b ) { long x = a ; a = b ; b = x ; } for ( long s = n ; s <= 9 * n ; s ++ ) { if ( ! check ( s , a , b ) ) continue ; if ( s < n * b || ( s - n * b ) % ( a - b ) != 0 ) continue ; long numDig = ( s - n * b ) / ( a - b ) ; if ( numDig > n ) continue ; long curr = fact [ n ] ; curr = ( curr * inv [ numDig ] ) % MOD ; curr = ( curr * inv [ n - numDig ] ) % MOD ; ans = ( ans + curr ) % MOD ; } return ans ; } static void Main ( ) { long n = 3 , a = 1 , b = 3 ; Console . WriteLine ( countNumbers ( n , a , b ) ) ; } }

Index/key variables: MAX, i, n, numDig
Accumulator variables: i, num, s
Iterator variables: i, s
Class/struct names: GFG
C# program:
using System ; class GFG { static int countOddSquares ( int n , int m ) { return ( int ) Math . Pow ( m , 0.5 ) - ( int ) Math . Pow ( n - 1 , 0.5 ) ; } static public void Main ( ) { int n = 5 , m = 100 ; Console . WriteLine ( " Count ▁ is ▁ " + ( ( m - n + 1 ) - countOddSquares ( n , m ) ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int Square ( int row , int column , int moves ) { int a = 0 , b = 0 , c = 0 , d = 0 , total = 0 ; a = row - moves ; b = row + moves ; c = column - moves ; d = column + moves ; if ( a < 1 ) a = 1 ; if ( c < 1 ) c = 1 ; if ( b > 8 ) b = 8 ; if ( d > 8 ) d = 8 ; total = ( b - a + 1 ) * ( d - c + 1 ) - 1 ; return total ; } public static void Main ( ) { int R = 4 , C = 5 , M = 2 ; Console . Write ( Square ( R , C , M ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int findNumber ( int n , int m ) { int num = ( m - 1 ) * 9 + n ; return num ; } public static void Main ( ) { int n = 2 , m = 5 ; Console . Write ( findNumber ( n , m ) ) ; } }

Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static bool checkTriangularSumRepresentation ( int n ) { HashSet < int > tri = new HashSet < int > ( ) ; int i = 1 ; while ( true ) { int x = i * ( i + 1 ) / 2 ; if ( x >= n ) { break ; } tri . Add ( x ) ; i ++ ; } foreach ( int tm in tri ) { if ( tri . Contains ( n - tm ) ) { return true ; } } return false ; } public static void Main ( String [ ] args ) { int n = 24 ; if ( checkTriangularSumRepresentation ( n ) ) { Console . WriteLine ( " Yes " ) ; } else { Console . WriteLine ( " No " ) ; } } }

Accumulator variables: i
Iterator variables: tm
Class/struct names: GFG
C# program:
using System ; class GFG { static int digitsCount ( int n ) { int len = 0 ; while ( n > 0 ) { len ++ ; n /= 10 ; } return len ; } static int absoluteFirstLast ( int n , int x ) { int i = 0 , mod = 1 ; while ( i < x ) { mod *= 10 ; i ++ ; } int last = n % mod ; int len = digitsCount ( n ) ; while ( len != x ) { n /= 10 ; len -- ; } int first = n ; return Math . Abs ( first - last ) ; } public static void Main ( String [ ] args ) { int n = 21546 , x = 2 ; Console . Write ( absoluteFirstLast ( n , x ) ) ; } }

Accumulator variables: i, len, mod, n
Class/struct names: GFG
C# program:
using System ; class GFG { public static void make_sequence ( int N ) { int [ ] arr = new int [ N + 1 ] ; int sum = 0 ; for ( int i = 1 ; i <= N ; i ++ ) { if ( i % 2 == 1 ) arr [ i ] = 1 ; else arr [ i ] = 2 ; sum += arr [ i ] ; } if ( sum % 2 == 1 ) arr [ 2 ] = 3 ; for ( int i = 1 ; i <= N ; i ++ ) Console . Write ( arr [ i ] + " ▁ " ) ; } public static void Main ( ) { int N = 9 ; make_sequence ( N ) ; } }

Index/key variables: i
Accumulator variables: i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int countOdd ( int L , int R ) { int N = ( R - L ) / 2 ; if ( R % 2 != 0 L % 2 != 0 ) N ++ ; return N ; } public static void Main ( ) { int L = 3 , R = 7 ; int odds = countOdd ( L , R ) ; int evens = ( R - L + 1 ) - odds ; Console . WriteLine ( " Count ▁ of ▁ odd ▁ numbers ▁ is ▁ " + odds ) ; Console . WriteLine ( " Count ▁ of ▁ even ▁ numbers ▁ is ▁ " + evens ) ; } }

Accumulator variables: N
Class/struct names: GFG
C# program:
using System ; class GFG { static int getMinCost ( int n , int m ) { int cost = ( n - 1 ) * m + ( m - 1 ) * n ; return cost ; } public static void Main ( ) { int n = 4 , m = 5 ; Console . WriteLine ( getMinCost ( n , m ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void minOperation ( int n , int k , int [ ] a ) { for ( int i = k ; i < n ; i ++ ) { if ( a [ i ] != a [ k - 1 ] ) Console . WriteLine ( - 1 ) ; } for ( int i = k - 2 ; i > - 1 ; i -- ) { if ( a [ i ] != a [ k - 1 ] ) Console . WriteLine ( i + 1 ) ; } } static public void Main ( ) { int n = 5 ; int k = 3 ; int [ ] a = { 2 , 1 , 1 , 1 , 1 } ; minOperation ( n , k , a ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int binomialCoeff ( int n , int k ) { if ( k > n ) return 0 ; int res = 1 ; if ( k > n - k ) k = n - k ; for ( int i = 0 ; i < k ; ++ i ) { res *= ( n - i ) ; res /= ( i + 1 ) ; } return res ; } public static void Main ( ) { int N = 5 , M = 1 ; int P = ( N * ( N - 1 ) ) / 2 ; Console . Write ( binomialCoeff ( P , M ) ) ; } }

Accumulator variables: res
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void generateSequence ( int n , int g ) { for ( int i = 1 ; i <= n ; i ++ ) Console . Write ( i * g + " ▁ " ) ; } public static void Main ( ) { int n = 6 , g = 5 ; generateSequence ( n , g ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int MAX = 1000 ; static int [ ] f = new int [ MAX ] ; static int fib ( int n ) { if ( n == 0 ) return 0 ; if ( n == 1 n == 2 ) return ( f [ n ] = 1 ) ; if ( f [ n ] != 0 ) return f [ n ] ; int k = 0 ; if ( ( n & 1 ) != 0 ) k = ( n + 1 ) / 2 ; else k = n / 2 ; if ( ( n & 1 ) != 0 ) f [ n ] = ( fib ( k ) * fib ( k ) + fib ( k - 1 ) * fib ( k - 1 ) ) ; else f [ n ] = ( 2 * fib ( k - 1 ) + fib ( k ) ) * fib ( k ) ; return f [ n ] ; } static int gcd ( int a , int b ) { if ( a == 0 ) return b ; return gcd ( b % a , a ) ; } static int findLCMFibonacci ( int a , int b ) { return ( fib ( a ) * fib ( b ) ) / fib ( gcd ( a , b ) ) ; } static void Main ( ) { int a = 3 , b = 12 ; Console . WriteLine ( findLCMFibonacci ( a , b ) ) ; } }

Index/key variables: MAX, n
Class/struct names: GFG
C# program:
using System ; class GFG { static string isEvenOrOdd ( int L , int R ) { int oddCount = ( R - L ) / 2 ; if ( R % 2 == 1 L % 2 == 1 ) oddCount ++ ; if ( oddCount % 2 == 0 ) return " Even " ; else return " Odd " ; } public static void Main ( ) { int L = 5 , R = 15 ; Console . WriteLine ( isEvenOrOdd ( L , R ) ) ; } }

Accumulator variables: oddCount
Class/struct names: GFG
C# program:
using System ; class GFG { static int trailing_zeros ( int N ) { int count_of_two = 0 , count_of_five = 0 ; for ( int i = 1 ; i <= N ; i ++ ) { int val = i ; while ( val % 2 == 0 && val > 0 ) { val /= 2 ; count_of_two += i ; } while ( val % 5 == 0 && val > 0 ) { val /= 5 ; count_of_five += i ; } } int ans = Math . Min ( count_of_two , count_of_five ) ; return ans ; } public static void Main ( ) { int N = 12 ; Console . WriteLine ( trailing_zeros ( N ) ) ; } }

Accumulator variables: count_of_five, count_of_two, i, val
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int limit = 1000000000 ; static int MAX_PRIME = 2000000 ; static int MAX = 1000000 ; static int I_MAX = 50000 ; static Dictionary < int , int > mp = new Dictionary < int , int > ( ) ; static int [ ] b = new int [ MAX ] ; static int [ ] p = new int [ MAX ] ; static int j = 0 ; static bool [ ] prime = new bool [ MAX_PRIME + 1 ] ; static void SieveOfEratosthenes ( int n ) { for ( int i = 0 ; i < MAX_PRIME + 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 ; } } for ( int p = 2 ; p <= n ; p ++ ) { if ( prime [ p ] ) { b [ j ++ ] = p ; } } } static int gcd ( int a , int b ) { if ( b == 0 ) return a ; return gcd ( b , a % b ) ; } static void printSeries ( int n ) { SieveOfEratosthenes ( MAX_PRIME ) ; int i , g , k , l , m , d ; int [ ] ar = new int [ I_MAX + 2 ] ; for ( i = 0 ; i < j ; i ++ ) { if ( ( b [ i ] * b [ i + 1 ] ) > limit ) break ; p [ i ] = b [ i ] ; mp . Add ( b [ i ] * b [ i + 1 ] , 1 ) ; } d = 550 ; bool flag = false ; for ( k = 2 ; ( k < d - 1 ) && ! flag ; k ++ ) { for ( m = 2 ; ( m < d ) && ! flag ; m ++ ) { for ( l = m + k ; l < d ; l += k ) { if ( ( ( b [ l ] * b [ l + k ] ) < limit ) && mp . ContainsKey ( b [ l ] * b [ l + k ] ) && mp . ContainsKey ( p [ i - 1 ] * b [ l ] ) && ( l + k ) < d && p [ i - 1 ] != b [ l + k ] && p [ i - 1 ] != b [ l ] && mp [ b [ l ] * b [ l + k ] ] != 1 ) { if ( mp [ p [ i - 1 ] * b [ l ] ] != 1 ) { p [ i ] = b [ l ] ; mp . Add ( p [ i - 1 ] * b [ l ] , 1 ) ; i ++ ; } } if ( i >= I_MAX ) { flag = true ; break ; } } } } for ( i = 0 ; i < n ; i ++ ) ar [ i ] = p [ i ] * p [ i + 1 ] ; for ( i = 0 ; i < n - 1 ; i ++ ) Console . Write ( ar [ i ] + " ▁ " ) ; g = gcd ( ar [ n - 1 ] , ar [ n - 2 ] ) ; Console . Write ( g * 2 ) ; } public static void Main ( String [ ] args ) { int n = 4 ; printSeries ( n ) ; } }

Index/key variables: MAX, i, l, p
Accumulator variables: i, j, k, l, m, p
Iterator variables: i, k, l, m, p
Boolean variables: flag
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int MAX = 620000 ; static int [ ] prime = new int [ MAX ] ; static void Sieve ( ) { for ( int i = 2 ; i < MAX ; i ++ ) { if ( prime [ i ] == 0 ) { for ( int j = 2 * i ; j < MAX ; j += i ) { prime [ j ] = 1 ; } } } } static void printSequence ( int n ) { Sieve ( ) ; List < int > v = new List < int > ( ) ; List < int > u = new List < int > ( ) ; for ( int i = 13 ; i < MAX ; i ++ ) { if ( prime [ i ] == 0 ) { v . Add ( i ) ; } } if ( n == 3 ) { Console . Write ( 6 + " ▁ " + 10 + " ▁ " + 15 ) ; return ; } int k ; for ( k = 0 ; k < n - 2 ; k ++ ) { if ( k % 3 == 0 ) { u . Add ( v [ k ] * 6 ) ; } else if ( k % 3 == 1 ) { u . Add ( v [ k ] * 15 ) ; } else { u . Add ( v [ k ] * 10 ) ; } } k -- ; u . Add ( v [ k ] * 7 ) ; u . Add ( 7 * 11 ) ; u [ 0 ] = u [ 0 ] * 11 ; for ( int i = 0 ; i < u . Count ; i ++ ) { Console . Write ( u [ i ] + " ▁ " ) ; } } public static void Main ( String [ ] args ) { int n = 4 ; printSequence ( n ) ; } }

Index/key variables: MAX, i, j, k
Accumulator variables: i, j, k
Iterator variables: i, j, k
Class/struct names: GFG
C# program:
using System ; class GFG { static void midptellipse ( double rx , double ry , double xc , double yc ) { double dx , dy , d1 , d2 , x , y ; x = 0 ; y = ry ; d1 = ( ry * ry ) - ( rx * rx * ry ) + ( 0.25f * rx * rx ) ; dx = 2 * ry * ry * x ; dy = 2 * rx * rx * y ; while ( dx < dy ) { Console . WriteLine ( String . Format ( " { 0:0.000000 } " , ( x + xc ) ) + " , ▁ " + String . Format ( " { 0:0.000000 } " , ( y + yc ) ) ) ; Console . WriteLine ( String . Format ( " { 0:0.000000 } " , ( - x + xc ) ) + " , ▁ " + String . Format ( " { 0:0.000000 } " , ( y + yc ) ) ) ; Console . WriteLine ( String . Format ( " { 0:0.000000 } " , ( x + xc ) ) + " , ▁ " + String . Format ( " { 0:0.000000 } " , ( - y + yc ) ) ) ; Console . WriteLine ( String . Format ( " { 0:0.000000 } " , ( - x + xc ) ) + " , ▁ " + String . Format ( " { 0:0.000000 } " , ( - y + yc ) ) ) ; if ( d1 < 0 ) { x ++ ; dx = dx + ( 2 * ry * ry ) ; d1 = d1 + dx + ( ry * ry ) ; } else { x ++ ; y -- ; dx = dx + ( 2 * ry * ry ) ; dy = dy - ( 2 * rx * rx ) ; d1 = d1 + dx - dy + ( ry * ry ) ; } } d2 = ( ( ry * ry ) * ( ( x + 0.5f ) * ( x + 0.5f ) ) ) + ( ( rx * rx ) * ( ( y - 1 ) * ( y - 1 ) ) ) - ( rx * rx * ry * ry ) ; while ( y >= 0 ) { Console . WriteLine ( String . Format ( " { 0:0.000000 } " , ( x + xc ) ) + " , ▁ " + String . Format ( " { 0:0.000000 } " , ( y + yc ) ) ) ; Console . WriteLine ( String . Format ( " { 0:0.000000 } " , ( - x + xc ) ) + " , ▁ " + String . Format ( " { 0:0.000000 } " , ( y + yc ) ) ) ; Console . WriteLine ( String . Format ( " { 0:0.000000 } " , ( x + xc ) ) + " , ▁ " + String . Format ( " { 0:0.000000 } " , ( - y + yc ) ) ) ; Console . WriteLine ( String . Format ( " { 0:0.000000 } " , ( - x + xc ) ) + " , ▁ " + String . Format ( " { 0:0.000000 } " , ( - y + yc ) ) ) ; if ( d2 > 0 ) { y -- ; dy = dy - ( 2 * rx * rx ) ; d2 = d2 + ( rx * rx ) - dy ; } else { y -- ; x ++ ; dx = dx + ( 2 * ry * ry ) ; dy = dy - ( 2 * rx * rx ) ; d2 = d2 + dx - dy + ( rx * rx ) ; } } } static void Main ( ) { midptellipse ( 10 , 15 , 50 , 50 ) ; } }

Accumulator variables: x, y
Class/struct names: GFG
C# program:
using System ; class GFG { static String isDivisible ( long n ) { long temp = n ; int sum = 0 ; while ( n != 0 ) { int k = ( int ) n % 10 ; sum += k ; n /= 10 ; } if ( temp % sum == 0 ) return " YES " ; return " NO " ; } public static void Main ( ) { long n = 123 ; Console . WriteLine ( isDivisible ( n ) ) ; } }

Accumulator variables: n, sum
Class/struct names: GFG
C# program:
using System ; public class GFG { static String getResult ( int n ) { String st = String . Join ( " " , n ) ; int sum = 0 ; foreach ( char i in st . ToCharArray ( ) ) { sum = sum + ( int ) i ; } if ( n % sum == 0 ) return " Yes " ; else return " No " ; } public static void Main ( String [ ] args ) { int n = 123 ; Console . WriteLine ( getResult ( n ) ) ; } }

Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void alter ( long x , long y ) { while ( true ) { if ( x == 0 y == 0 ) break ; if ( x >= 2 * y ) x = x % ( 2 * y ) ; else if ( y >= 2 * x ) y = y % ( 2 * x ) ; else break ; } Console . WriteLine ( " X ▁ = ▁ " + x + " , ▁ " + " Y ▁ = ▁ " + y ) ; } public static void Main ( ) { long x = 12 , y = 5 ; alter ( x , y ) ; } }

Class/struct names: GFG
C# program:
class GFG { static int digitProduct ( int n ) { int prod = 1 ; while ( n > 0 ) { prod = prod * ( n % 10 ) ; n = n / 10 ; } return prod ; } static void printMultiplicativePrimes ( int n ) { bool [ ] prime = new bool [ n + 1 ] ; for ( int i = 0 ; i <= n ; i ++ ) prime [ i ] = true ; prime [ 0 ] = prime [ 1 ] = false ; for ( int p = 2 ; p * p <= n ; p ++ ) { if ( prime [ p ] ) { for ( int i = p * 2 ; i <= n ; i += p ) prime [ i ] = false ; } } for ( int i = 2 ; i <= n ; i ++ ) { if ( prime [ i ] && prime [ digitProduct ( i ) ] ) System . Console . Write ( i + " ▁ " ) ; } } static void Main ( ) { int n = 10 ; printMultiplicativePrimes ( n ) ; } }

Index/key variables: i, p
Accumulator variables: i, p
Iterator variables: i, p
Class/struct names: GFG
C# program:
using System ; class GFG { static int gcd ( int a , int b ) { if ( b == 0 ) return a ; else return gcd ( b , a % b ) ; } static bool coPrime ( int n1 , int n2 ) { if ( gcd ( n1 , n2 ) == 1 ) return true ; else return false ; } static int largestCoprime ( int N ) { int half = ( int ) ( N / 2 ) ; while ( coPrime ( N , half ) == false ) half -- ; return half ; } static void Main ( ) { int n = 50 ; Console . WriteLine ( largestCoprime ( n ) ) ; } }

Accumulator variables: half
Class/struct names: GFG
C# program:
using System ; class GfG { static int largestCoprime ( int N ) { if ( N == 6 ) return 1 ; else if ( N % 4 == 0 ) return ( N / 2 ) - 1 ; else if ( N % 2 == 0 ) return ( N / 2 ) - 2 ; else return ( ( N - 1 ) / 2 ) ; } public static void Main ( ) { int n = 50 ; Console . WriteLine ( largestCoprime ( n ) ) ; } }

Class/struct names: GfG
C# program:
using System ; class GFG { static void printSafePrimes ( int n ) { int [ ] prime = new int [ n + 1 ] ; for ( int i = 2 ; i <= n ; i ++ ) prime [ i ] = 1 ; prime [ 0 ] = prime [ 1 ] = 0 ; for ( int p = 2 ; p * p <= n ; p ++ ) { if ( prime [ p ] == 1 ) { for ( int i = p * 2 ; i <= n ; i += p ) prime [ i ] = 0 ; } } for ( int i = 2 ; i <= n ; i ++ ) { if ( prime [ i ] != 0 ) { int temp = ( 2 * i ) + 1 ; if ( temp <= n && prime [ temp ] != 0 ) prime [ temp ] = 2 ; } } for ( int i = 5 ; i <= n ; i ++ ) if ( prime [ i ] == 2 ) Console . Write ( i + " ▁ " ) ; } public static void Main ( ) { int n = 20 ; printSafePrimes ( n ) ; } }

Index/key variables: i, p, temp
Accumulator variables: i, p
Iterator variables: i, p
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static List < int > Divisors ( int x ) { int c = 0 ; List < int > v = new List < int > ( ) ; while ( x % 2 == 0 ) { c ++ ; x /= 2 ; } v . Add ( c ) ; c = 0 ; while ( x % 3 == 0 ) { c ++ ; x /= 3 ; } v . Add ( c ) ; c = 0 ; while ( x % 7 == 0 ) { c ++ ; x /= 7 ; } v . Add ( c ) ; v . Add ( x ) ; return v ; } static int MinOperations ( int a , int b ) { List < int > va = Divisors ( a ) ; List < int > vb = Divisors ( b ) ; if ( va [ 3 ] != vb [ 3 ] ) { return - 1 ; } int minOperations = Math . Abs ( va [ 0 ] - vb [ 0 ] ) + Math . Abs ( va [ 1 ] - vb [ 1 ] ) + Math . Abs ( va [ 2 ] - vb [ 2 ] ) ; return minOperations ; } public static void Main ( String [ ] args ) { int a = 14 , b = 28 ; Console . WriteLine ( MinOperations ( a , b ) ) ; } }

Accumulator variables: c, x
Class/struct names: GFG
C# program:
using System ; class GFG { static int largestOddDigit ( int n ) { int maxOdd = - 1 ; while ( n > 0 ) { int digit = n % 10 ; if ( digit % 2 == 1 && digit > maxOdd ) maxOdd = digit ; n = n / 10 ; } return maxOdd ; } static int getProduct ( int n ) { int maxOdd = largestOddDigit ( n ) ; if ( maxOdd == - 1 ) return - 1 ; return ( n * maxOdd ) ; } public static void Main ( ) { int n = 12345 ; Console . Write ( getProduct ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static bool isPerfectSquare ( int x ) { long left = 1 , right = x ; while ( left <= right ) { long mid = ( left + right ) / 2 ; if ( mid * mid == x ) { return true ; } if ( mid * mid < x ) { left = mid + 1 ; } else { right = mid - 1 ; } } return false ; } public static void Main ( string [ ] args ) { int x = 2500 ; if ( isPerfectSquare ( x ) ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int n = 1000002 ; static int [ ] phi = new int [ n + 2 ] ; static int [ ] ans = new int [ n + 2 ] ; static void ETF ( ) { for ( int i = 1 ; i <= n ; i ++ ) { phi [ i ] = i ; } for ( int i = 2 ; i <= n ; i ++ ) { if ( phi [ i ] == i ) { phi [ i ] = i - 1 ; for ( int j = 2 * i ; j <= n ; j += i ) { phi [ j ] = ( phi [ j ] * ( i - 1 ) ) / i ; } } } } static int LcmSum ( int m ) { ETF ( ) ; for ( int i = 1 ; i <= n ; i ++ ) { for ( int j = i ; j <= n ; j += i ) { ans [ j ] += ( i * phi [ i ] ) ; } } int answer = ans [ m ] ; answer = ( answer + 1 ) * m ; answer = answer / 2 ; return answer ; } static void Main ( ) { int m = 5 ; Console . WriteLine ( LcmSum ( m ) ) ; } }

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