dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; class GFG { static double area_of_regular_polygon ( double n , double len ) { double P = ( len * n ) ; double A = len / ( 2 * Math . Tan ( ( 180 / n ) * 3.14159 / 180 ) ) ; double area = ( P * A ) / 2 ; return area ; } static double area_of_triangle_inscribed ( double n , double len ) { double area = area_of_regular_polygon ( n , len ) ; double triangle = area / n ; double ins_tri = ( triangle * 3 ) ; return ins_tri ; } static public void Main ( String [ ] arg ) { double n = 6 , len = 10 ; Console . Write ( " { 0 : F3 } " , area_of_triangle_inscribed ( n , len ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static float Area ( int d , int h1 , int h2 ) { float area ; area = ( float ) 0.5 * d * ( h1 + h2 ) ; return area ; } public static void Main ( ) { int d = 6 , h1 = 4 , h2 = 3 ; Console . WriteLine ( " Area ▁ of ▁ Quadrilateral ▁ = ▁ " + Area ( d , h1 , h2 ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static float diagonal_length ( float a ) { float L ; L = a * ( float ) Math . Sqrt ( 3 ) ; return L ; } public static void Main ( ) { float a = 5 ; Console . Write ( diagonal_length ( a ) ) ; } }

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

Class/struct names: GFG
C# program:
using System ; public class GFG { static double PI = 3.14 ; static double find_area ( int r , int d ) { double R = d / PI ; R += Math . Pow ( r , 2 ) ; R = Math . Sqrt ( R ) ; double area = PI * Math . Pow ( R , 2 ) ; return area ; } static public void Main ( ) { int r = 4 , d = 5 ; Console . Write ( find_area ( r , d ) ) ; } }

Accumulator variables: R
Class/struct names: GFG
C# program:
class GFG { static bool Valid ( int a , int b , int c , int d ) { if ( a + b + c + d == 360 ) return true ; return false ; } public static void Main ( ) { int a = 80 , b = 70 , c = 100 , d = 110 ; if ( Valid ( a , b , c , d ) ) Console . WriteLine ( " Valid ▁ quadrilateral " ) ; else Console . WriteLine ( " Invalid ▁ quadrilateral " ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static double calculate_angle ( double n ) { double total_angle = 360 ; return total_angle / n ; } public static void Main ( ) { double N = 5 ; Console . WriteLine ( calculate_angle ( N ) ) ; } }

Class/struct names: GFG
C# program:
using System ; public class GFG { static float angleOncirCumference ( float z ) { return ( z / 2 ) ; } public static void Main ( String [ ] args ) { float angle = 65 ; float z = angleOncirCumference ( angle ) ; Console . WriteLine ( " The ▁ angle ▁ is ▁ " + z + " ▁ degrees " ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void PrintMaxMinValue ( double a , double b , double c ) { double secondPart = c * 1.0 - ( b * b / ( 4.0 * a ) ) ; if ( a > 0 ) { Console . Write ( " Maxvalue ▁ = ▁ " + " Infinity STRNEWLINE " ) ; Console . Write ( " Minvalue ▁ = ▁ " + secondPart ) ; } else if ( a < 0 ) { Console . Write ( " Maxvalue ▁ = ▁ " + secondPart + " STRNEWLINE " ) ; Console . Write ( " Minvalue ▁ = ▁ " + " - Infinity " ) ; } else { Console . Write ( " Not ▁ a ▁ quadratic ▁ function STRNEWLINE " ) ; } } static public void Main ( ) { double a = - 1 , b = 3 , c = - 2 ; PrintMaxMinValue ( a , b , c ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void newvol ( double x ) { Console . WriteLine ( " percentage ▁ increase ▁ " + " in ▁ the ▁ volume ▁ of ▁ the ▁ cylinder ▁ is ▁ " + x + " % " ) ; } public static void Main ( ) { double x = 10 ; newvol ( x ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void radius ( double n , double d ) { Console . WriteLine ( " The ▁ side ▁ of ▁ each ▁ square ▁ is ▁ " + d / ( ( n - 1 ) * Math . Sqrt ( 2 ) ) ) ; } public static void Main ( ) { double d = 42 , n = 4 ; radius ( n , d ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static double innerCirclearea ( double radius ) { if ( radius < 0 ) { return - 1 ; } double r = radius / 2 ; double Area = ( 3.14 * Math . Pow ( r , 2 ) ) ; return Area ; } public static void Main ( String [ ] arr ) { double radius = 4 ; Console . WriteLine ( " Area ▁ of ▁ circle ▁ c2 ▁ = ▁ " + innerCirclearea ( radius ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void angleequichord ( int z ) { Console . WriteLine ( " The ▁ angle ▁ subtended ▁ at ▁ the ▁ center ▁ is ▁ " + z + " ▁ degrees " ) ; } public static void Main ( String [ ] args ) { int z = 48 ; angleequichord ( z ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void lengequichord ( int z ) { Console . WriteLine ( " The ▁ distance ▁ between ▁ the ▁ " + " chord ▁ and ▁ the ▁ center ▁ is ▁ " + z ) ; } public static void Main ( ) { int z = 48 ; lengequichord ( z ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void lengperpbisect ( double r1 , double r2 ) { double z = 2 * Math . Sqrt ( ( r1 * r1 ) - ( ( r1 - r2 ) * ( r1 - r2 ) / 4 ) ) ; Console . WriteLine ( " The ▁ length ▁ of ▁ the ▁ " + " perpendicular ▁ bisector ▁ is ▁ " + z ) ; } public static void Main ( ) { double r1 = 5 , r2 = 3 ; lengperpbisect ( r1 , r2 ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void lengchord ( int z ) { Console . WriteLine ( " The ▁ length ▁ is ▁ " + z ) ; } static public void Main ( ) { int z = 48 ; lengchord ( z ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static double distcenter ( int r1 , int r2 , int x ) { double z = ( Math . Sqrt ( ( r1 * r1 ) - ( x / 2 * x / 2 ) ) ) + ( Math . Sqrt ( ( r2 * r2 ) - ( x / 2 * x / 2 ) ) ) ; Console . WriteLine ( " distance ▁ between ▁ the " + " ▁ centers ▁ is ▁ " + ( int ) z ) ; return 0 ; } static public void Main ( ) { int r1 = 24 , r2 = 37 , x = 40 ; distcenter ( r1 , r2 , x ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void angleextcycquad ( int z ) { Console . WriteLine ( " The ▁ exterior ▁ angle ▁ of ▁ the " + " ▁ cyclic ▁ quadrilateral ▁ is ▁ " + z + " ▁ degrees " ) ; } public static void Main ( ) { int z = 48 ; angleextcycquad ( z ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void anglechordtang ( int z ) { Console . WriteLine ( " The ▁ angle ▁ between ▁ tangent " + " ▁ and ▁ the ▁ chord ▁ is ▁ " + z + " ▁ degrees " ) ; } public static void Main ( ) { int z = 48 ; anglechordtang ( z ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static bool isPerfect ( int N ) { int sumOfDivisors = 1 ; for ( int i = 2 ; i <= N / 2 ; ++ i ) { if ( N % i == 0 ) { sumOfDivisors += i ; } } if ( sumOfDivisors == N ) { return true ; } else return false ; } static int sumOfDigits ( int N ) { int sum = 0 ; while ( N != 0 ) { sum += ( N % 10 ) ; N = N / 10 ; } return sum ; } static void countPerfectNumbers ( int [ ] arr , int N ) { for ( int i = 0 ; i < N ; ++ i ) { if ( isPerfect ( arr [ i ] ) ) { int sum = sumOfDigits ( arr [ i ] ) ; if ( isPerfect ( sum ) ) { Console . Write ( arr [ i ] + " ▁ " ) ; } } } } static public void Main ( ) { int [ ] arr = { 3 , 8 , 12 , 28 , 6 } ; int N = arr . Length ; countPerfectNumbers ( arr , N ) ; } }

Index/key variables: i
Accumulator variables: sum, sumOfDivisors
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static Dictionary < Tuple < int , int > , int > dp = new Dictionary < Tuple < int , int > , int > ( ) ; static int maxPreSum ( int [ ] a , int [ ] b , int x , int y ) { if ( dp . ContainsKey ( new Tuple < int , int > ( x , y ) ) ) return dp [ new Tuple < int , int > ( x , y ) ] ; if ( x == a . Length && y == b . Length ) return 0 ; int curr = 0 ; if ( dp . ContainsKey ( new Tuple < int , int > ( x , y ) ) ) { curr = dp [ new Tuple < int , int > ( x , y ) ] ; } if ( x == a . Length ) { curr = Math . Max ( curr , b [ y ] + maxPreSum ( a , b , x , y + 1 ) ) ; } else if ( y == b . Length ) { curr = Math . Max ( curr , a [ x ] + maxPreSum ( a , b , x + 1 , y ) ) ; } else { int max = Math . Max ( a [ x ] + maxPreSum ( a , b , x + 1 , y ) , b [ y ] + maxPreSum ( a , b , x , y + 1 ) ) ; curr = Math . Max ( curr , max ) ; } dp [ new Tuple < int , int > ( x , y ) ] = curr ; return dp [ new Tuple < int , int > ( x , y ) ] ; } static void Main ( ) { int [ ] A = { 2 , 1 , 13 , 5 , 14 } ; int [ ] B = { - 1 , 4 , - 13 } ; Console . WriteLine ( maxPreSum ( A , B , 0 , 0 ) ) ; } }

Index/key variables: x, y
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { class TreeNode { public int val ; public TreeNode left , right ; } ; static TreeNode newNode ( int x ) { TreeNode temp = new TreeNode ( ) ; temp . val = x ; temp . left = null ; temp . right = null ; return temp ; } static int findSum ( TreeNode root ) { Queue < TreeNode > que = new Queue < TreeNode > ( ) ; que . Enqueue ( root ) ; int ans = 0 ; while ( que . Count > 0 ) { int leaf = 0 ; int nonleaf = 0 ; int length = que . Count ; while ( length > 0 ) { TreeNode temp = que . Peek ( ) ; que . Dequeue ( ) ; if ( temp . left == null && temp . right == null ) leaf += temp . val ; else nonleaf += temp . val ; if ( temp . left != null ) que . Enqueue ( temp . left ) ; if ( temp . right != null ) que . Enqueue ( temp . right ) ; length -= 1 ; } ans += ( leaf & nonleaf ) ; } return ans ; } public static void Main ( ) { TreeNode root = newNode ( 5 ) ; root . left = newNode ( 3 ) ; root . right = newNode ( 9 ) ; root . left . left = newNode ( 6 ) ; root . left . right = newNode ( 4 ) ; root . left . left . right = newNode ( 7 ) ; Console . WriteLine ( findSum ( root ) ) ; } }

Accumulator variables: ans, leaf, length, nonleaf
Class/struct names: GFG, TreeNode
C# program:
using System ; using System . Collections . Generic ; class GFG { static void MinTime ( int [ ] a , int [ ] b , int n , int m ) { int ans = 2147483647 ; int [ ] prefix_a = new int [ 10 ] ; int [ ] prefix_b = new int [ 10 ] ; Array . Clear ( prefix_a , 0 , prefix_a . Length ) ; Array . Clear ( prefix_b , 0 , prefix_b . Length ) ; for ( int i = 0 ; i < n ; i ++ ) { prefix_a [ a [ i ] ] ++ ; } for ( int i = 0 ; i < m ; i ++ ) { prefix_b [ b [ i ] ] ++ ; } for ( int i = 1 ; i <= 9 ; i ++ ) { prefix_a [ i ] += prefix_a [ i - 1 ] ; } for ( int i = 1 ; i <= 9 ; i ++ ) { prefix_b [ i ] += prefix_b [ i - 1 ] ; } for ( int i = 0 ; i <= 9 ; i ++ ) { ans = Math . Min ( ans , prefix_a [ i ] + m - prefix_b [ i ] ) ; ans = Math . Min ( ans , n - prefix_a [ i ] + prefix_b [ i ] ) ; } Console . WriteLine ( ans ) ; } public static void Main ( ) { int [ ] A = { 0 , 0 , 1 , 3 , 3 } ; int [ ] B = { 2 , 0 , 3 } ; int N = A . Length ; int M = B . Length ; MinTime ( A , B , N , M ) ; } }

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 int findReverse ( int N ) { int rev = 0 ; while ( N > 0 ) { rev <<= 1 ; if ( ( N & 1 ) == 1 ) rev ^= 1 ; N >>= 1 ; } return rev ; } static void countElements ( int [ ] arr , int N ) { List < int > ans = new List < int > ( ) ; for ( int i = 0 ; i < N ; i ++ ) { ans . Add ( findReverse ( arr [ i ] ) ) ; } Dictionary < int , int > cnt = new Dictionary < int , int > ( ) ; for ( int i = 0 ; i < N ; i ++ ) { cnt [ arr [ i ] ] = 1 ; } int count = 0 ; foreach ( int i in ans ) { if ( cnt . ContainsKey ( i ) ) count ++ ; } Console . WriteLine ( count ) ; } public static void Main ( ) { int [ ] arr = { 1 , 30 , 3 , 8 , 12 } ; int N = arr . Length ; countElements ( arr , N ) ; } }

Index/key variables: i
Accumulator variables: count, i, rev
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void fizzBuzz ( int N ) { int count3 = 0 ; int count5 = 0 ; for ( int i = 1 ; i <= N ; i ++ ) { count3 ++ ; count5 ++ ; bool flag = false ; if ( count3 == 3 ) { Console . Write ( " Fizz " ) ; count3 = 0 ; flag = true ; } if ( count5 == 5 ) { Console . Write ( " Buzz " ) ; count5 = 0 ; flag = true ; } if ( ! flag ) { Console . Write ( i ) ; } Console . Write ( " ▁ " ) ; } } public static void Main ( String [ ] args ) { int N = 15 ; fizzBuzz ( N ) ; } }

Accumulator variables: count3, count5, i
Iterator variables: i
Boolean variables: flag
Class/struct names: GFG
C# program:
using System ; class GFG { static bool [ ] prime = new bool [ 1000005 ] ; static void SieveOfEratosthenes ( int N ) { Array . Fill ( prime , true ) ; prime [ 0 ] = false ; prime [ 1 ] = false ; for ( int p = 2 ; p * p <= N ; p ++ ) { if ( prime [ p ] == true ) { for ( int i = p * p ; i <= N ; i += p ) prime [ i ] = false ; } } } static void checkElementsOnDiagonal ( int [ , ] M , int N ) { int flag = 1 ; SieveOfEratosthenes ( 1000000 ) ; for ( int i = 0 ; i < N ; i ++ ) { bool flg = ( bool ) ( prime [ M [ i , i ] ] && prime [ M [ i , N - 1 - i ] ] ) ; int val = ( flg ) ? 1 : 0 ; flag &= val ; } if ( flag != 0 ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } public static void Main ( string [ ] args ) { int [ , ] M = { { 1 , 2 , 3 , 13 } , { 5 , 3 , 7 , 8 } , { 1 , 2 , 3 , 4 } , { 5 , 6 , 7 , 7 } } ; int N = M . GetLength ( 0 ) ; checkElementsOnDiagonal ( M , N ) ; } }

Index/key variables: i, p
Accumulator variables: flag, i, p
Iterator variables: i, p
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; public class GFG { public static List < int > circularPermutation ( int n , int start ) { List < int > res = new List < int > ( ) { 0 } ; List < int > ret = new List < int > ( ) ; int index = - 1 ; for ( int k = 0 , add = 1 << k ; k < n ; k ++ , add = 1 << k ) { for ( int i = res . Count - 1 ; i >= 0 ; i -- ) { if ( res [ i ] + add == start ) index = res . Count ; res . Add ( res [ i ] + add ) ; } } if ( start == 0 ) return res ; while ( ret . Count < res . Count ) { ret . Add ( res [ index ] ) ; index = ( index + 1 ) % res . Count ; } return ret ; } static public void Main ( ) { int N = 2 , S = 3 ; List < int > print = circularPermutation ( N , S ) ; Console . Write ( " [ " ) ; for ( int i = 0 ; i < print . Count - 1 ; i ++ ) { Console . Write ( print [ i ] + " , ▁ " ) ; } Console . Write ( print [ print . Count - 1 ] + " ] " ) ; } }

Index/key variables: i, index
Accumulator variables: i, k
Iterator variables: i, k
Class/struct names: GFG
C# program:
using System ; class GFG { static int countPairs ( int [ ] a , int n ) { int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = i + 1 ; j < n ; j ++ ) { if ( a [ j ] != 0 && a [ i ] % a [ j ] == 0 ) { if ( ( a [ i ] + a [ j ] ) == ( a [ i ] / a [ j ] ) ) count ++ ; } } } return count ; } static void Main ( ) { int [ ] arr = { - 4 , - 3 , 0 , 2 , 1 } ; int N = arr . Length ; Console . WriteLine ( countPairs ( 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 int countPairs ( int [ ] a , int n ) { int count = 0 ; Dictionary < double , int > mp = new Dictionary < double , int > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { int y = a [ i ] ; if ( y != 0 && y != 1 ) { double x = ( ( y * 1.0 ) / ( 1 - y ) ) * y ; if ( ! mp . ContainsKey ( x ) ) mp [ x ] = 0 ; count += mp [ x ] ; } if ( ! mp . ContainsKey ( y ) ) mp [ y ] = 0 ; mp [ y ] ++ ; } return count ; } public static void Main ( ) { int [ ] arr = { - 4 , - 3 , 0 , 2 , 1 } ; int N = arr . Length ; Console . Write ( countPairs ( arr , N ) ) ; } }

Index/key variables: i, x, y
Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static bool contains ( int num , int K , int Base ) { bool isThere = false ; while ( num > 0 ) { int remainder = num % Base ; if ( remainder == K ) { isThere = true ; } num /= Base ; } return isThere ; } static void count ( int n , int k , List < List < int > > v ) { int [ ] pref = new int [ 1000005 ] ; for ( int i = 1 ; i < 1e6 + 5 ; i ++ ) { bool present = contains ( i , k , 10 ) || contains ( i , k , 8 ) ; if ( present ) { pref [ i ] += pref [ i - 1 ] + 1 ; } } Console . Write ( ( v [ 0 ] [ 1 ] - v [ 0 ] [ 0 ] + 1 - ( pref [ v [ 0 ] [ 1 ] ] - pref [ v [ 0 ] [ 0 ] - 1 ] ) ) + " ▁ " ) ; Console . Write ( ( v [ 1 ] [ 1 ] - v [ 1 ] [ 0 ] - ( pref [ v [ 1 ] [ 1 ] ] - pref [ v [ 1 ] [ 0 ] - 1 ] ) ) + " ▁ " ) ; } static void Main ( ) { int K = 7 ; List < List < int > > Q = new List < List < int > > ( ) ; Q . Add ( new List < int > ( ) ) ; Q [ 0 ] . Add ( 2 ) ; Q [ 0 ] . Add ( 5 ) ; Q . Add ( new List < int > ( ) ) ; Q [ 1 ] . Add ( 1 ) ; Q [ 1 ] . Add ( 15 ) ; int N = Q . Count ; count ( N , K , Q ) ; } }

Index/key variables: i
Accumulator variables: i, num
Iterator variables: i
Boolean variables: isThere
Class/struct names: GFG
C# program:
using System ; public class GFG { static int numberOfTiles ( int n , int m ) { if ( n % 2 == 1 ) { return - 1 ; } return ( m * n ) / 2 ; } static public void Main ( ) { int n = 2 , m = 4 ; Console . WriteLine ( numberOfTiles ( n , m ) ) ; } }

Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void canMakeEqual ( int [ ] arr1 , int [ ] arr2 , int N ) { int count = 0 ; int arr1_one = 0 , arr1_zero = 0 ; int arr2_one = 0 , arr2_zero = 0 ; for ( int i = 0 ; i < N ; i ++ ) { if ( arr1 [ i ] == 1 ) { arr1_one ++ ; } else if ( arr1 [ i ] == 0 ) { arr1_zero ++ ; } if ( arr2 [ i ] == 1 ) { arr2_one ++ ; } else if ( arr2 [ i ] == 0 ) { arr2_zero ++ ; } } if ( arr1_one != arr2_one arr1_zero != arr2_zero ) { Console . WriteLine ( " No " ) ; return ; } for ( int i = 0 ; i < N ; i ++ ) { count = count + ( arr1 [ i ] - arr2 [ i ] ) ; if ( count < 0 ) { Console . WriteLine ( " No " ) ; return ; } } Console . WriteLine ( " Yes " ) ; } public static void Main ( ) { int [ ] arr1 = { 0 , 1 , 1 , 0 } ; int [ ] arr2 = { 0 , 0 , 1 , 1 } ; int N = arr1 . Length ; canMakeEqual ( arr1 , arr2 , N ) ; } }

Index/key variables: i
Accumulator variables: arr1_one, arr1_zero, arr2_one, arr2_zero, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; using System . Linq ; class GFG { static void checksubarrayExist1_N ( int [ ] arr , int N ) { Dictionary < int , int > pos = new Dictionary < int , int > ( ) ; for ( int i = 0 ; i < N ; i ++ ) { pos [ arr [ i ] ] = i ; } HashSet < int > st = new HashSet < int > ( ) ; for ( int i = 1 ; i <= N ; i ++ ) { st . Add ( pos [ i ] ) ; int Min = st . Min ( ) ; int Max = st . Max ( ) ; if ( Max - Min + 1 == i ) { Console . Write ( " True ▁ " ) ; } else { Console . Write ( " False ▁ " ) ; } } } public static void Main ( string [ ] args ) { int [ ] arr = { 1 , 4 , 3 , 2 } ; int N = arr . Length ; checksubarrayExist1_N ( arr , N ) ; } }

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 checkSamePosition ( int [ ] arr , int n ) { Dictionary < int , int > mp = new Dictionary < int , int > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { int temp = ( ( i + arr [ i ] ) % n + n ) % n ; if ( mp . ContainsKey ( temp ) ) { Console . Write ( " Yes " ) ; return ; } mp [ temp ] = 1 ; } Console . Write ( " No " ) ; } static void Main ( ) { int [ ] arr = { 5 , 4 , 3 } ; int N = arr . Length ; checkSamePosition ( arr , N ) ; } }

Index/key variables: i, temp
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public static void sumFib ( int N ) { long num = ( long ) Math . Round ( Math . Pow ( ( Math . Sqrt ( 5 ) + 1 ) / 2.0 , N + 2 ) / Math . Sqrt ( 5 ) ) ; Console . WriteLine ( num - 1 ) ; } static public void Main ( ) { int N = 3 ; sumFib ( N ) ; } }

Class/struct names: GFG
C# program:
using System ; public class GFG { public static void sumFib ( int N ) { double num = ( 1 - Math . Sqrt ( 5 ) ) / 2 ; double val = Math . Round ( Math . Abs ( 1 / ( Math . Pow ( num , N + 2 ) + Math . Pow ( num , N + 1 ) + Math . Pow ( num , N ) + Math . Pow ( num , N - 1 ) ) ) - 1 ) ; Console . WriteLine ( val ) ; } public static void Main ( String [ ] args ) { int N = 3 ; sumFib ( N ) ; } }

Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; public class GFG { static void minOperations ( int [ ] arr , int n , int k ) { Dictionary < int , int > mp = new Dictionary < int , int > ( ) ; 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 ) ; } } int ans = 0 ; while ( mp . ContainsKey ( k ) == false mp [ k ] < n ) { for ( int i = 1 ; i <= k - 1 ; i ++ ) { if ( mp . ContainsKey ( i ) && mp [ i ] > 0 ) { mp [ i ] = mp [ i ] - 1 ; if ( mp . ContainsKey ( i + 1 ) ) mp [ i + 1 ] = mp [ i + 1 ] + 1 ; else mp . Add ( i + 1 , 1 ) ; if ( mp . ContainsKey ( i + 1 ) && mp [ i + 1 ] == 1 ) { i ++ ; } } } ans ++ ; } Console . Write ( ans ) ; } public static void Main ( String [ ] args ) { int [ ] arr = { 2 , 3 , 3 , 4 } ; int K = 5 ; int N = arr . Length ; minOperations ( arr , N , K ) ; } }

Index/key variables: i, k
Accumulator variables: ans, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void poorPigs ( int buckets , int minutesToDie , int minutesToTest ) { Console . WriteLine ( ( int ) Math . Ceiling ( Math . Log ( buckets ) / Math . Log ( ( minutesToTest / minutesToDie ) + 1 ) ) ) ; } static public void Main ( ) { int N = 1000 , M = 15 , P = 60 ; poorPigs ( N , M , P ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void maxProduct ( int [ ] arr , int N ) { int max_product = Int32 . MinValue ; int prefix_sum = 0 ; int sum = 0 ; for ( int i = 0 ; i < N ; i ++ ) { sum += arr [ i ] ; } for ( int i = 0 ; i < N - 1 ; i ++ ) { prefix_sum += arr [ i ] ; int X = prefix_sum ; int Y = sum - prefix_sum ; max_product = Math . Max ( max_product , X * Y ) ; } Console . WriteLine ( max_product ) ; } static void Main ( ) { int [ ] arr = { 2 , 3 , 5 , 6 , 7 } ; int N = arr . Length ; maxProduct ( arr , N ) ; } }

Index/key variables: i
Accumulator variables: i, prefix_sum, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class GFG { static int findMask ( int K ) { int mask = 1 ; while ( ( K & mask ) == 0 ) { mask = mask << 1 ; } return mask ; } public static void sameRightSetBitPos ( int [ ] arr , int N , int K ) { int mask = findMask ( K ) ; int pos = ( K & mask ) ; for ( int i = 0 ; i < N ; i ++ ) { if ( ( arr [ i ] & mask ) == pos ) Console . Write ( arr [ i ] + " ▁ " ) ; } } static public void Main ( ) { int [ ] arr = { 3 , 4 , 6 , 7 , 9 , 12 , 15 } ; int N = arr . Length ; int K = 7 ; sameRightSetBitPos ( arr , N , K ) ; } }

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