dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; class GFG { class Node { public int data ; public Node next ; } ; static Node create ( Node head , int x ) { Node temp , ptr = head ; temp = new Node ( ) ; temp . data = x ; temp . next = null ; if ( head == null ) head = temp ; else { while ( ptr . next != null ) { ptr = ptr . next ; } ptr . next = temp ; } return head ; } static Node removeNthFromEnd ( Node head , int B ) { int len = 0 ; Node tmp = head ; while ( tmp != null ) { len ++ ; tmp = tmp . next ; } if ( B > len ) { Console . Write ( " Length ▁ of ▁ the ▁ linked ▁ list ▁ is ▁ " + len ) ; Console . Write ( " ▁ we ▁ can ' t ▁ remove ▁ " + B + " th ▁ node ▁ from ▁ the " ) ; Console . Write ( " ▁ linked ▁ list STRNEWLINE " ) ; return head ; } else if ( B == len ) { return head . next ; } else { int diff = len - B ; Node prev = null ; Node curr = head ; for ( int i = 0 ; i < diff ; i ++ ) { prev = curr ; curr = curr . next ; } prev . next = curr . next ; return head ; } } static void display ( Node head ) { Node temp = head ; while ( temp != null ) { Console . Write ( temp . data + " ▁ " ) ; temp = temp . next ; } Console . Write ( " STRNEWLINE " ) ; } public static void Main ( String [ ] args ) { Node head = null ; head = create ( head , 1 ) ; head = create ( head , 2 ) ; head = create ( head , 3 ) ; head = create ( head , 4 ) ; head = create ( head , 5 ) ; Console . Write ( " Linked ▁ list ▁ before ▁ modification : ▁ STRNEWLINE " ) ; display ( head ) ; head = removeNthFromEnd ( head , 2 ) ; Console . Write ( " Linked ▁ list ▁ after ▁ modification : ▁ STRNEWLINE " ) ; display ( head ) ; } }

Accumulator variables: i, len
Iterator variables: i
Class/struct names: GFG, Node
C# program:
using System ; class GFG { static void solveEven ( int n , int [ ] arr , int [ ] b ) { int left = n - 1 ; for ( int i = 0 ; i < ( n / 2 ) ; ++ i ) { b [ i ] = arr [ left ] ; left = left - 2 ; if ( left < 0 ) break ; } int right = 0 ; for ( int i = n / 2 ; i <= n - 1 ; ++ i ) { b [ i ] = arr [ right ] ; right = right + 2 ; if ( right > n - 2 ) break ; } } static void solveOdd ( int n , int [ ] arr , int [ ] b ) { int left = n - 1 ; for ( int i = 0 ; i < ( n / 2 ) + 1 ; ++ i ) { b [ i ] = arr [ left ] ; left = left - 2 ; if ( left < 0 ) break ; } int right = 1 ; for ( int i = ( n / 2 ) + 1 ; i <= n - 1 ; ++ i ) { b [ i ] = arr [ right ] ; right = right + 2 ; if ( right > n - 2 ) break ; } } static void solve ( int n , int [ ] arr ) { int [ ] b = new int [ n ] ; if ( n % 2 == 0 ) solveEven ( n , arr , b ) ; else solveOdd ( n , arr , b ) ; for ( int i = 0 ; i <= n - 1 ; ++ i ) { Console . Write ( b [ i ] + " ▁ " ) ; } } public static void Main ( ) { int [ ] arr = { 1 , 2 , 3 , 4 } ; int n = arr . Length ; solve ( n , arr ) ; } }

Index/key variables: i, left, n, right
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public static void sum_of_elements ( int [ ] arr , int n ) { int sumfirst = 0 , sumsecond = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( i < n / 2 ) { sumfirst += arr [ i ] ; } else { sumsecond += arr [ i ] ; } } Console . WriteLine ( " Sum ▁ of ▁ first ▁ half ▁ elements ▁ is ▁ " + sumfirst ) ; Console . WriteLine ( " Sum ▁ of ▁ second ▁ half ▁ elements ▁ is ▁ " + sumsecond ) ; } static public void Main ( ) { int [ ] arr = { 20 , 30 , 60 , 10 , 25 , 15 , 40 } ; int n = arr . Length ; sum_of_elements ( arr , n ) ; } }

Index/key variables: i
Accumulator variables: i, sumfirst, sumsecond
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int minimum_sum ( int n , int k ) { if ( k % n == 0 ) return 0 ; return 1 ; } static public void Main ( ) { int n = 3 , k = 56 ; Console . Write ( minimum_sum ( n , k ) ) ; } }

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

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public class Node { public int data ; public Node next ; } ; static Node insert ( Node root , int item ) { Node ptr , temp ; temp = new Node ( ) ; temp . data = item ; temp . next = null ; if ( root == null ) root = temp ; else { ptr = root ; while ( ptr . next != null ) ptr = ptr . next ; ptr . next = temp ; } return root ; } static Node newList ( Node root1 , Node root2 ) { Node ptr1 = root1 , ptr2 = root2 , ptr ; Node root = null , temp ; while ( ptr1 != null ) { temp = new Node ( ) ; temp . next = null ; if ( ptr1 . data < ptr2 . data ) temp . data = ptr2 . data ; else temp . data = ptr1 . data ; if ( root == null ) root = temp ; else { ptr = root ; while ( ptr . next != null ) ptr = ptr . next ; ptr . next = temp ; } ptr1 = ptr1 . next ; ptr2 = ptr2 . next ; } return root ; } static void display ( Node root ) { while ( root != null ) { Console . Write ( root . data + " - > " ) ; root = root . next ; } Console . WriteLine ( ) ; } public static void Main ( String [ ] args ) { Node root1 = null , root2 = null , root = null ; root1 = insert ( root1 , 5 ) ; root1 = insert ( root1 , 2 ) ; root1 = insert ( root1 , 3 ) ; root1 = insert ( root1 , 8 ) ; Console . Write ( " First ▁ List : ▁ " ) ; display ( root1 ) ; root2 = insert ( root2 , 1 ) ; root2 = insert ( root2 , 7 ) ; root2 = insert ( root2 , 4 ) ; root2 = insert ( root2 , 5 ) ; Console . Write ( " Second ▁ List : ▁ " ) ; display ( root2 ) ; root = newList ( root1 , root2 ) ; Console . Write ( " New ▁ List : ▁ " ) ; display ( root ) ; } }

Class/struct names: GFG, Node
C# program:
using System ; class GFG { static int gcd ( int a , int b ) { if ( b == 0 ) return a ; return gcd ( b , a % b ) ; } static int countQuadruplets ( int l , int r , int k ) { int count = 0 ; for ( int u = l ; u <= r ; u ++ ) { for ( int v = l ; v <= r ; v ++ ) { for ( int w = l ; w <= r ; w ++ ) { for ( int x = l ; x <= r ; x ++ ) { if ( gcd ( gcd ( u , v ) , gcd ( w , x ) ) == k ) count ++ ; } } } } return count ; } static public void Main ( ) { int l = 1 , r = 10 , k = 2 ; Console . WriteLine ( countQuadruplets ( l , r , k ) ) ; } }

Accumulator variables: count, u, v, w, x
Iterator variables: u, v, w, x
Class/struct names: GFG
C# program:
using System ; class GFG { static int findIndex ( int [ ] a , int n ) { int res = 0 ; long min_diff = Int64 . MaxValue ; long [ ] prod = new long [ n ] ; prod [ 0 ] = a [ 0 ] ; for ( int i = 1 ; i < n ; i ++ ) prod [ i ] = prod [ i - 1 ] * a [ i ] ; for ( int i = 0 ; i < n - 1 ; i ++ ) { long curr_diff = Math . Abs ( ( prod [ n - 1 ] / prod [ i ] ) - prod [ i ] ) ; if ( curr_diff < min_diff ) { min_diff = curr_diff ; res = i ; } } return res ; } static void Main ( ) { int [ ] arr = { 3 , 2 , 5 , 7 , 2 , 9 } ; int N = arr . Length ; Console . WriteLine ( findIndex ( arr , N ) ) ; } }

Index/key variables: i, n
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void printNumbers ( int [ ] a , int n , int x ) { bool flag = false ; for ( int i = 0 ; i < n ; i ++ ) { int num = a [ i ] ; int g = __gcd ( num , x ) ; while ( g != 1 ) { num /= g ; g = __gcd ( num , x ) ; } if ( num == 1 ) { flag = true ; Console . Write ( a [ i ] + " ▁ " ) ; } } if ( ! flag ) Console . WriteLine ( " There ▁ are ▁ no ▁ such ▁ numbers " ) ; } static int __gcd ( int a , int b ) { if ( b == 0 ) return a ; return __gcd ( b , a % b ) ; } public static void Main ( String [ ] args ) { int x = 60 ; int [ ] a = { 2 , 5 , 10 , 7 , 17 } ; int n = a . Length ; printNumbers ( a , n , x ) ; } }

Index/key variables: i
Accumulator variables: i, num
Iterator variables: i
Boolean variables: flag
Class/struct names: GFG
C# program:
using System ; class GFG { static void print ( int [ ] rStation , int n ) { for ( int i = 1 ; i <= n ; i ++ ) Console . Write ( rStation [ i ] + " ▁ " ) ; Console . WriteLine ( " " ) ; } static void radiated_Station ( int [ ] station , int n ) { int [ ] rStation = new int [ n + 1 ] ; for ( int i = 1 ; i <= n ; i ++ ) { int li = i - 1 , ri = i + 1 ; int lRad = station [ i ] - 1 , rRad = station [ i ] - 1 ; rStation [ i ] += station [ i ] ; while ( li >= 1 && lRad >= 1 ) { rStation [ li -- ] += lRad -- ; } while ( ri <= n && rRad >= 1 ) { rStation [ ri ++ ] += rRad -- ; } } print ( rStation , n ) ; } public static void Main ( String [ ] args ) { int [ ] station = { 0 , 7 , 9 , 12 , 2 , 5 } ; int n = station . Length - 1 ; radiated_Station ( station , n ) ; } }

Index/key variables: i
Accumulator variables: i, lRad, li, rRad, ri
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int findMaximumDiff ( int [ ] a , int n ) { int ind1 = 0 ; for ( int i = n - 1 ; i > 0 ; i -- ) { if ( a [ 0 ] != a [ i ] ) { ind1 = i ; break ; } } int ind2 = 0 ; for ( int i = 0 ; i < n - 1 ; i ++ ) { if ( a [ n - 1 ] != a [ i ] ) { ind2 = ( n - 1 - i ) ; break ; } } return Math . Max ( ind1 , ind2 ) ; } static void Main ( ) { int [ ] a = { 1 , 2 , 3 , 2 , 3 } ; int n = a . Length ; Console . WriteLine ( findMaximumDiff ( a , n ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections ; using System . Collections . Generic ; class GFG { static int n ; static ArrayList tree = new ArrayList ( ) ; static int currentIdx ; static int [ ] startIdx ; static int [ ] endIdx ; static int [ ] p ; static void Add_edge ( int u , int v ) { ( ( ArrayList ) tree [ u ] ) . Add ( v ) ; ( ( ArrayList ) tree [ v ] ) . Add ( u ) ; } static void intisalise ( ) { startIdx = new int [ n + 1 ] ; endIdx = new int [ n + 1 ] ; p = new int [ n + 1 ] ; } static void Dfs ( int ch , int par ) { p [ currentIdx ] = ch ; startIdx [ ch ] = currentIdx ++ ; foreach ( int c in ( ArrayList ) tree [ ch ] ) { if ( c != par ) Dfs ( c , ch ) ; } endIdx [ ch ] = currentIdx - 1 ; } static int findNode ( int v , int k ) { k += startIdx [ v ] - 1 ; if ( k <= endIdx [ v ] ) return p [ k ] ; return - 1 ; } public static void Main ( string [ ] args ) { n = 9 ; for ( int i = 0 ; i <= n ; i ++ ) tree . Add ( new ArrayList ( ) ) ; Add_edge ( 1 , 2 ) ; Add_edge ( 1 , 3 ) ; Add_edge ( 1 , 4 ) ; Add_edge ( 3 , 5 ) ; Add_edge ( 3 , 7 ) ; Add_edge ( 5 , 6 ) ; Add_edge ( 5 , 8 ) ; Add_edge ( 7 , 9 ) ; intisalise ( ) ; Dfs ( 1 , 0 ) ; int v = 3 , k = 4 ; Console . Write ( findNode ( v , k ) ) ; } }

Index/key variables: ch, currentIdx, k, u, v
Accumulator variables: currentIdx, i, k
Iterator variables: c, i
Class/struct names: GFG
C# program:
using System ; class GFG { static int sum ( int k , int n ) { int sum = ( int ) ( Math . Pow ( k , n + 1 ) - Math . Pow ( k - 1 , n + 1 ) ) ; return sum ; } public static void Main ( ) { int n = 3 ; int K = 3 ; Console . Write ( sum ( K , n ) ) ; } }

Class/struct names: GFG
C# program:
class GfG { static bool is_prime ( int num ) { int count = 0 ; for ( int i = 1 ; i * i <= ( num ) ; i ++ ) { if ( ( num ) % i == 0 ) { if ( i * i != ( num ) ) count += 2 ; else count ++ ; } } if ( count == 2 ) return true ; else return false ; } static string is_divisible ( int n ) { if ( n == 1 ) { return " YES " ; } else { if ( is_prime ( n + 1 ) ) return " NO " ; else return " YES " ; } } static void Main ( ) { int n ; n = 3 ; System . Console . WriteLine ( is_divisible ( n ) ) ; n = 4 ; System . Console . WriteLine ( is_divisible ( n ) ) ; } }

Accumulator variables: count, i
Iterator variables: i
Class/struct names: GfG
C# program:
using System ; using System . Collections . Generic ; class GFG { static readonly int MAX = 100005 ; static long [ ] partial_sum ( long [ ] prefix_sum , int [ ] arr , int n ) { for ( int i = 1 ; i <= n ; i ++ ) { prefix_sum [ i ] = ( prefix_sum [ i - 1 ] + arr [ i - 1 ] ) ; } return prefix_sum ; } static int countSubarrays ( int [ ] arr , int n , int k ) { long [ ] prefix_sum = new long [ MAX ] ; prefix_sum [ 0 ] = 0 ; prefix_sum = partial_sum ( prefix_sum , arr , n ) ; int sum ; if ( k == 1 ) { sum = 0 ; Dictionary < long , int > mp = new Dictionary < long , int > ( ) ; for ( int i = n ; i >= 0 ; i -- ) { if ( mp . ContainsKey ( prefix_sum [ i ] + 1 ) ) sum += mp [ prefix_sum [ i ] + 1 ] ; if ( mp . ContainsKey ( prefix_sum [ i ] ) ) mp . Add ( prefix_sum [ i ] , mp [ prefix_sum [ i ] ] + 1 ) ; else mp . Add ( prefix_sum [ i ] , 1 ) ; } return sum ; } if ( k == - 1 ) { sum = 0 ; Dictionary < long , int > map = new Dictionary < long , int > ( ) ; for ( int i = n ; i >= 0 ; i -- ) { if ( map . ContainsKey ( prefix_sum [ i ] + 1 ) ) sum += map [ prefix_sum [ i ] + 1 ] ; if ( map . ContainsKey ( prefix_sum [ i ] - 1 ) ) sum += map [ prefix_sum [ i ] - 1 ] ; if ( map . ContainsKey ( prefix_sum [ i ] ) ) map . Add ( prefix_sum [ i ] , map [ prefix_sum [ i ] ] + 1 ) ; else map . Add ( prefix_sum [ i ] , 1 ) ; } return sum ; } sum = 0 ; long b , l = 100000000000000L ; Dictionary < long , int > m = new Dictionary < long , int > ( ) ; for ( int i = n ; i >= 0 ; i -- ) { b = 1 ; while ( true ) { if ( b > l ) break ; if ( m . ContainsKey ( prefix_sum [ i ] + b ) ) sum += m [ prefix_sum [ i ] + b ] ; b *= k ; } if ( m . ContainsKey ( prefix_sum [ i ] ) ) m . Add ( ( prefix_sum [ i ] ) , m [ prefix_sum [ i ] ] + 1 ) ; else m . Add ( ( prefix_sum [ i ] ) , 1 ) ; } return sum ; } public static void Main ( String [ ] args ) { int [ ] arr = { 2 , 2 , 2 , 2 } ; int n = arr . Length ; int k = 2 ; Console . Write ( countSubarrays ( arr , n , k ) ) ; } }

Index/key variables: MAX, i
Accumulator variables: b, i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections ; class GFG { static int mod = ( int ) ( 1e9 + 7 ) ; static int BitOperations ( string a , int n , string b , int m ) { char [ ] ch1 = a . ToCharArray ( ) ; Array . Reverse ( ch1 ) ; a = new string ( ch1 ) ; char [ ] ch2 = b . ToCharArray ( ) ; Array . Reverse ( ch2 ) ; b = new string ( ch2 ) ; int c = 0 ; for ( int i = 0 ; i < m ; i ++ ) if ( b [ i ] == '1' ) c ++ ; int [ ] power = new int [ n ] ; power [ 0 ] = 1 ; for ( int i = 1 ; i < n ; i ++ ) power [ i ] = ( power [ i - 1 ] * 2 ) % mod ; int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( a [ i ] == '1' ) { ans += c * power [ i ] ; if ( ans >= mod ) ans %= mod ; } if ( b [ i ] == '1' ) c -- ; if ( c == 0 ) break ; } return ans ; } static void Main ( ) { string a = "1001" , b = "10101" ; int n = a . Length , m = b . Length ; Console . WriteLine ( BitOperations ( a , n , b , m ) ) ; } }

Index/key variables: i, n
Accumulator variables: ans, c, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System . Linq ; using System ; class GFG { static void sieve ( int maxEle , int [ ] prime ) { prime [ 0 ] = prime [ 1 ] = 1 ; for ( int i = 2 ; i * i <= maxEle ; i ++ ) { if ( prime [ i ] == 0 ) { for ( int j = 2 * i ; j <= maxEle ; j += i ) prime [ j ] = 1 ; } } } static int digitSum ( int n ) { int sum = 0 ; while ( n > 0 ) { sum += n % 10 ; n = n / 10 ; } return sum ; } static void printAdditivePrime ( int [ ] arr , int n ) { int maxEle = arr . Max ( ) ; int [ ] prime = new int [ maxEle + 1 ] ; sieve ( maxEle , prime ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( prime [ arr [ i ] ] == 0 ) { int sum = digitSum ( arr [ i ] ) ; if ( prime [ sum ] == 0 ) Console . Write ( arr [ i ] + " ▁ " ) ; } } } static void Main ( ) { int [ ] a = { 2 , 4 , 6 , 11 , 12 , 18 , 7 } ; int n = a . Length ; printAdditivePrime ( a , n ) ; } }

Index/key variables: i, j, sum
Accumulator variables: i, j, sum
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static long nthTerm ( long n ) { long nth ; if ( n % 2 == 0 ) nth = 2 * ( ( n * n ) - n ) ; else nth = ( 2 * n * n ) - n ; return nth ; } public static void Main ( ) { long n ; n = 5 ; Console . WriteLine ( nthTerm ( n ) ) ; n = 25 ; Console . WriteLine ( nthTerm ( n ) ) ; n = 25000000 ; Console . WriteLine ( nthTerm ( n ) ) ; n = 250000007 ; Console . WriteLine ( nthTerm ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; public class GFG { static int nthTerm ( int n ) { int An = ( ( int ) Math . Pow ( 1 , n ) + ( int ) Math . Pow ( 2 , n ) ) * ( int ) Math . Pow ( 3 , n ) ; return An ; } public static void Main ( ) { int n = 3 ; Console . WriteLine ( nthTerm ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; public class GFG { static int countDivisors ( int n ) { int x = 0 , ans = 1 ; while ( n % 2 == 0 ) { x ++ ; n = n / 2 ; } ans = ans * ( x + 1 ) ; for ( int i = 3 ; i <= Math . Sqrt ( n ) ; i = i + 2 ) { x = 0 ; while ( n % i == 0 ) { x ++ ; n = n / i ; } ans = ans * ( x + 1 ) ; } if ( n > 2 ) ans = ans * 2 ; return ans ; } static int getTotalCount ( int n , int k ) { int k_count = countDivisors ( k ) ; int count = 0 ; for ( int i = 1 ; i < n ; i ++ ) if ( k_count == countDivisors ( i ) ) count ++ ; if ( k < n ) count = count - 1 ; return count ; } public static void Main ( ) { int n = 500 , k = 6 ; Console . WriteLine ( getTotalCount ( n , k ) ) ; } }

Accumulator variables: count, i, x
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class GFG { static int nthTerm ( int n ) { int d = 2 ; int a1 = 0 ; int An = a1 + ( n - 1 ) * d ; return ( int ) Math . Pow ( An , 3 ) ; } public static void Main ( ) { int n = 5 ; Console . WriteLine ( nthTerm ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int MAX_VAL = 200000 ; static int countIntervals ( int [ , ] arr , int V , int N ) { int min = int . MaxValue , max = int . MinValue ; int li , ri ; int [ ] freq = new int [ MAX_VAL ] ; for ( int i = 0 ; i < N ; i ++ ) { li = arr [ i , 0 ] ; freq [ li ] = freq [ li ] + 1 ; ri = arr [ i , 1 ] ; freq [ ri + 1 ] = freq [ ri + 1 ] - 1 ; if ( li < min ) min = li ; if ( ri > max ) max = ri ; } for ( int i = min ; i <= max ; i ++ ) freq [ i ] = freq [ i ] + freq [ i - 1 ] ; return freq [ V ] ; } public static void Main ( ) { int [ , ] arr = new int [ , ] { { 1 , 10 } , { 5 , 10 } , { 15 , 25 } , { 7 , 12 } , { 20 , 25 } } ; int V = 7 ; int N = arr . Length / arr . Rank ; Console . WriteLine ( countIntervals ( arr , V , N ) ) ; } }

Index/key variables: MAX_VAL, V, i, li
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void printGroups ( int n ) { int x = 1 ; int y = n * n ; for ( int i = 1 ; i <= n ; i ++ ) { for ( int j = 1 ; j <= n / 2 ; j ++ ) { Console . Write ( " { ▁ " + x + " , ▁ " + y + " } ▁ " ) ; x ++ ; y -- ; } Console . WriteLine ( ) ; } } public static void Main ( ) { int n = 4 ; printGroups ( n ) ; } }

Accumulator variables: i, j, x, y
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { public static int breakEvenPoint ( int exp1 , int S , int M ) { double earn = S - M ; double exp = exp1 ; double res = Math . Ceiling ( exp / earn ) ; int res1 = ( int ) res ; return res1 ; } public static void Main ( ) { int exp = 3550 , S = 90 , M = 65 ; Console . WriteLine ( breakEvenPoint ( exp , S , M ) ) ; } }

Class/struct names: GFG
C# program:
class GFG { static int minimum ( int n ) { int product = 1 ; for ( int i = 2 ; i * i <= n ; i ++ ) { if ( n % i == 0 ) { while ( n % i == 0 ) n = n / i ; product = product * i ; } } if ( n >= 2 ) product = product * n ; return product ; } static void Main ( ) { int n = 20 ; System . Console . WriteLine ( minimum ( n ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class GFG { static int numbers ( int n , int [ ] arr , int m ) { int isZero = 0 , isFive = 0 ; int result = 0 ; if ( m < n ) { return - 1 ; } for ( int i = 0 ; i < m ; i ++ ) { if ( arr [ i ] == 0 ) { isZero = 1 ; } if ( arr [ i ] == 5 ) { isFive = 1 ; } } if ( isZero == 1 && isFive == 1 ) { result = 2 ; for ( int i = 0 ; i < n - 1 ; i ++ ) { result = result * ( -- m ) ; } } else if ( isZero == 1 isFive == 1 ) { result = 1 ; for ( int i = 0 ; i < n - 1 ; i ++ ) { result = result * ( -- m ) ; } } else { result = - 1 ; } return result ; } public static void Main ( ) { int n = 3 , m = 6 ; int [ ] arr = { 2 , 3 , 5 , 6 , 7 , 9 } ; Console . WriteLine ( numbers ( n , arr , m ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static public void Main ( ) { int a = 5 , b = 7 , c = 10 ; if ( a <= b && a <= c ) Console . WriteLine ( a + " ▁ is ▁ the ▁ smallest " ) ; else if ( b <= a && b <= c ) Console . WriteLine ( b + " ▁ is ▁ the ▁ smallest " ) ; else Console . WriteLine ( c + " ▁ is ▁ the ▁ smallest " ) ; } }

Class/struct names: GFG
C# program:
using System ; using System . Linq ; public class GFG { static void maxSum ( int [ ] a , int n ) { int maxAnd = a . Max ( ) ; int maxOR = 0 ; for ( int i = 0 ; i < n ; i ++ ) { maxOR |= a [ i ] ; } Console . Write ( ( maxAnd + maxOR ) ) ; } public static void Main ( ) { int n = 4 ; int [ ] a = { 3 , 5 , 6 , 1 } ; maxSum ( a , n ) ; } }

Index/key variables: i
Accumulator variables: i, maxOR
Iterator variables: i
Class/struct names: 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 sumSubarrayMins ( int [ ] A , int n ) { int [ ] left = new int [ n ] ; int [ ] right = new int [ n ] ; Stack < pair > s1 = new Stack < pair > ( ) ; Stack < pair > s2 = new Stack < pair > ( ) ; for ( int i = 0 ; i < n ; ++ i ) { int cnt = 1 ; while ( s1 . Count != 0 && ( s1 . Peek ( ) . first ) > A [ i ] ) { cnt += s1 . Peek ( ) . second ; s1 . Pop ( ) ; } s1 . Push ( new pair ( A [ i ] , cnt ) ) ; left [ i ] = cnt ; } for ( int i = n - 1 ; i >= 0 ; -- i ) { int cnt = 1 ; while ( s2 . Count != 0 && ( s2 . Peek ( ) . first ) >= A [ i ] ) { cnt += s2 . Peek ( ) . second ; s2 . Pop ( ) ; } s2 . Push ( new pair ( A [ i ] , cnt ) ) ; right [ i ] = cnt ; } int result = 0 ; for ( int i = 0 ; i < n ; ++ i ) result = ( result + A [ i ] * left [ i ] * right [ i ] ) ; return result ; } public static void Main ( String [ ] args ) { int [ ] A = { 3 , 1 , 2 , 4 } ; int n = A . Length ; Console . WriteLine ( sumSubarrayMins ( A , n ) ) ; } }

Index/key variables: i, n
Accumulator variables: cnt
Iterator variables: i
Class/struct names: GFG, pair
C# program:
using System ; class GFG { static int getMin ( int [ ] arr , int n , int k ) { int res = int . MaxValue ; for ( int i = 0 ; i < n ; i ++ ) { if ( arr [ i ] % k == 0 ) { res = Math . Min ( res , arr [ i ] ) ; } } return res ; } static int getMax ( int [ ] arr , int n , int k ) { int res = int . MinValue ; for ( int i = 1 ; i < n ; i ++ ) { if ( arr [ i ] % k == 0 ) { res = Math . Max ( res , arr [ i ] ) ; } } return res ; } static public void Main ( ) { int [ ] arr = { 10 , 1230 , 45 , 67 , 1 } ; int k = 10 ; int n = arr . Length ; Console . WriteLine ( " Minimum ▁ element ▁ of ▁ array ▁ " + " which ▁ is ▁ divisible ▁ by ▁ k : ▁ " + getMin ( arr , n , k ) ) ; Console . WriteLine ( " Maximum ▁ element ▁ of ▁ array ▁ " + " which ▁ is ▁ divisible ▁ by ▁ k : ▁ " + getMax ( arr , n , k ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void printNumberWithDR ( int k , int d ) { if ( d == 0 && k != 1 ) Console . Write ( " - 1" ) ; else { Console . Write ( d ) ; k -- ; while ( k -- > 0 ) Console . Write ( "0" ) ; } } static public void Main ( ) { int k = 4 , d = 4 ; printNumberWithDR ( k , d ) ; } }

Accumulator variables: k
Class/struct names: GFG