dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; class GFG { static int solve ( int M , int N , int s ) { if ( N % s == 0 ) { N = N / s ; } else { N = ( N / s ) + 1 ; } if ( M % s == 0 ) { M = M / s ; } else { M = ( M / s ) + 1 ; } return M * N ; } static void Main ( ) { int N = 12 , M = 13 , s = 4 ; Console . WriteLine ( solve ( M , N , s ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int solve ( double M , double N , double s ) { int ans = ( ( int ) ( Math . Ceiling ( M / s ) ) * ( int ) ( Math . Ceiling ( N / s ) ) ) ; return ans ; } public static void Main ( ) { double N = 12 , M = 13 , s = 4 ; Console . WriteLine ( solve ( M , N , s ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { { public int x ; public int y ; } static int orientation ( Point p , Point q , Point r ) { int val = ( q . y - p . y ) * ( r . x - q . x ) - ( q . x - p . x ) * ( r . y - q . y ) ; if ( val == 0 ) return 0 ; return ( val > 0 ) ? 1 : 2 ; } static bool doIntersect ( Point p1 , Point q1 , Point p2 , Point q2 ) { int o1 = orientation ( p1 , q1 , p2 ) ; int o2 = orientation ( p1 , q1 , q2 ) ; int o3 = orientation ( p2 , q2 , p1 ) ; int o4 = orientation ( p2 , q2 , q1 ) ; if ( o1 != o2 && o3 != o4 ) return true ; return false ; } static bool similar ( Point p1 , Point p2 ) { if ( p1 . x == p2 . x && p1 . y == p2 . y ) return false ; return true ; } static bool collinear ( Point p1 , Point p2 , Point p3 ) { int x1 = p1 . x , y1 = p1 . y ; int x2 = p2 . x , y2 = p2 . y ; int x3 = p3 . x , y3 = p3 . y ; if ( ( y3 - y2 ) * ( x2 - x1 ) == ( y2 - y1 ) * ( x3 - x2 ) ) return false ; else return true ; } static int no_of_quads ( Point p1 , Point p2 , Point p3 , Point p4 ) { bool same = true ; same = same & similar ( p1 , p2 ) ; same = same & similar ( p1 , p3 ) ; same = same & similar ( p1 , p4 ) ; same = same & similar ( p2 , p3 ) ; same = same & similar ( p2 , p4 ) ; same = same & similar ( p3 , p4 ) ; if ( same == false ) return 0 ; bool coll = true ; coll = coll & collinear ( p1 , p2 , p3 ) ; coll = coll & collinear ( p1 , p2 , p4 ) ; coll = coll & collinear ( p1 , p3 , p4 ) ; coll = coll & collinear ( p2 , p3 , p4 ) ; if ( coll == false ) return 0 ; int check = 0 ; if ( doIntersect ( p1 , p2 , p3 , p4 ) ) check = 1 ; if ( doIntersect ( p1 , p3 , p2 , p4 ) ) check = 1 ; if ( doIntersect ( p1 , p2 , p4 , p3 ) ) check = 1 ; if ( check == 0 ) return 3 ; return 1 ; } static void Main ( ) { Point p1 , p2 , p3 , p4 ; p1 = new Point ( ) ; p2 = new Point ( ) ; p3 = new Point ( ) ; p4 = new Point ( ) ; p1 . x = 0 ; p1 . y = 9 ; p2 . x = - 1 ; p2 . y = 0 ; p3 . x = 5 ; p3 . y = - 1 ; p4 . x = 5 ; p4 . y = 9 ; Console . WriteLine ( no_of_quads ( p1 , p2 , p3 , p4 ) ) ; p1 . x = 0 ; p1 . y = 9 ; p2 . x = - 1 ; p2 . y = 0 ; p3 . x = 5 ; p3 . y = - 1 ; p4 . x = 0 ; p4 . y = 3 ; Console . WriteLine ( no_of_quads ( p1 , p2 , p3 , p4 ) ) ; p1 . x = 0 ; p1 . y = 9 ; p2 . x = 0 ; p2 . y = 10 ; p3 . x = 0 ; p3 . y = 11 ; p4 . x = 0 ; p4 . y = 12 ; Console . WriteLine ( no_of_quads ( p1 , p2 , p3 , p4 ) ) ; p1 . x = 0 ; p1 . y = 9 ; p2 . x = 0 ; p2 . y = 9 ; p3 . x = 5 ; p3 . y = - 1 ; p4 . x = 0 ; p4 . y = 3 ; Console . WriteLine ( no_of_quads ( p1 , p2 , p3 , p4 ) ) ; } }

Boolean variables: coll, same
Class/struct names: GFG
C# program:
using System ; class GFG { static void equation_plane ( float x1 , float y1 , float z1 , float x2 , float y2 , float z2 , float x3 , float y3 , float z3 ) { float a1 = x2 - x1 ; float b1 = y2 - y1 ; float c1 = z2 - z1 ; float a2 = x3 - x1 ; float b2 = y3 - y1 ; float c2 = z3 - z1 ; float a = b1 * c2 - b2 * c1 ; float b = a2 * c1 - a1 * c2 ; float c = a1 * b2 - b1 * a2 ; float d = ( - a * x1 - b * y1 - c * z1 ) ; Console . Write ( " equation ▁ of ▁ plane ▁ is ▁ " + a + " x ▁ + ▁ " + b + " y ▁ + ▁ " + c + " z ▁ + ▁ " + d + " ▁ = ▁ 0" ) ; } public static void Main ( ) { float x1 = - 1 ; float y1 = 2 ; float z1 = 1 ; float x2 = 0 ; float y2 = - 3 ; float z2 = 2 ; float x3 = 1 ; float y3 = 1 ; float z3 = - 4 ; equation_plane ( x1 , y1 , z1 , x2 , y2 , z2 , x3 , y3 , z3 ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void shortest_distance ( float x1 , float y1 , float a , float b , float c ) { double d = Math . Abs ( ( ( a * x1 + b * y1 + c ) ) / ( Math . Sqrt ( a * a + b * b ) ) ) ; Console . WriteLine ( " Perpendicular ▁ " + " distance ▁ is ▁ " + d ) ; return ; } public static void Main ( ) { float x1 = 5 ; float y1 = 6 ; float a = - 2 ; float b = 3 ; float c = 4 ; shortest_distance ( x1 , y1 , a , b , c ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void octant ( float x , float y , float z ) { if ( x >= 0 && y >= 0 && z >= 0 ) Console . WriteLine ( " Point ▁ lies ▁ in ▁ 1st ▁ octant " ) ; else if ( x < 0 && y >= 0 && z >= 0 ) Console . WriteLine ( " Point ▁ lies ▁ in ▁ 2nd ▁ octant " ) ; else if ( x < 0 && y < 0 && z >= 0 ) Console . WriteLine ( " Point ▁ lies ▁ in ▁ 3rd ▁ octant " ) ; else if ( x >= 0 && y < 0 && z >= 0 ) Console . WriteLine ( " Point ▁ lies ▁ in ▁ 4th ▁ octant " ) ; else if ( x >= 0 && y >= 0 && z < 0 ) Console . WriteLine ( " Point ▁ lies ▁ in ▁ 5th ▁ octant " ) ; else if ( x < 0 && y >= 0 && z < 0 ) Console . WriteLine ( " Point ▁ lies ▁ in ▁ 6th ▁ octant " ) ; else if ( x < 0 && y < 0 && z < 0 ) Console . WriteLine ( " Point ▁ lies ▁ in ▁ 7th ▁ octant " ) ; else if ( x >= 0 && y < 0 && z < 0 ) Console . WriteLine ( " Point ▁ lies ▁ in ▁ 8th ▁ octant " ) ; } static public void Main ( ) { float x = 2 , y = 3 , z = 4 ; octant ( x , y , z ) ; x = - 4 ; y = 2 ; z = - 8 ; octant ( x , y , z ) ; x = - 6 ; y = - 2 ; z = 8 ; octant ( x , y , z ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int countNumberOfTriangles ( int n ) { return n * ( n - 1 ) * ( n - 2 ) / 6 ; } public static void Main ( ) { int n = 4 ; Console . WriteLine ( countNumberOfTriangles ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static long centeredTridecagonalNum ( long n ) { return ( 13 * n * ( n - 1 ) + 2 ) / 2 ; } public static void Main ( ) { long n = 3 ; Console . WriteLine ( centeredTridecagonalNum ( n ) ) ; n = 10 ; Console . WriteLine ( centeredTridecagonalNum ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int pentagon_pyramidal ( int n ) { int sum = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { int p = ( 3 * i * i - i ) / 2 ; sum = sum + p ; } return sum ; } static public void Main ( ) { int n = 4 ; Console . WriteLine ( pentagon_pyramidal ( n ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int pentagon_pyramidal ( int n ) { return n * n * ( n + 1 ) / 2 ; } static public void Main ( ) { int n = 4 ; Console . WriteLine ( pentagon_pyramidal ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static bool checkConcurrent ( int a1 , int b1 , int c1 , int a2 , int b2 , int c2 , int a3 , int b3 , int c3 ) { return ( a3 * ( b1 * c2 - b2 * c1 ) + b3 * ( c1 * a2 - c2 * a1 ) + c3 * ( a1 * b2 - a2 * b1 ) == 0 ) ; } public static void Main ( ) { int a1 = 2 , b1 = - 3 , c1 = 5 ; int a2 = 3 , b2 = 4 , c2 = - 7 ; int a3 = 9 , b3 = - 5 , c3 = 8 ; if ( checkConcurrent ( a1 , b1 , c1 , a2 , b2 , c2 , a3 , b3 , c3 ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int center_octadecagon_num ( int n ) { return 9 * n * n - 9 * n + 1 ; } static public void Main ( ) { int n = 3 ; Console . Write ( n + " th ▁ centered ▁ " + " octadecagonal ▁ number ▁ : ▁ " ) ; Console . WriteLine ( center_octadecagon_num ( n ) ) ; n = 13 ; Console . Write ( n + " th ▁ centered ▁ " + " octadecagonal ▁ number ▁ : ▁ " ) ; Console . WriteLine ( center_octadecagon_num ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int centereddecagonalnum ( int n ) { return ( 5 * n * n + 5 * n + 1 ) ; } static public void Main ( ) { int n = 5 ; Console . Write ( n + " th ▁ centered ▁ decagonal " + " number : ▁ " ) ; Console . WriteLine ( centereddecagonalnum ( n ) ) ; n = 9 ; Console . Write ( n + " th ▁ centered ▁ decagonal " + " number : ▁ " ) ; Console . WriteLine ( centereddecagonalnum ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int factorial ( int a , int b ) { int res = 1 ; for ( int i = 1 ; i <= ( a + b ) ; i ++ ) res = res * i ; for ( int i = 1 ; i <= a ; i ++ ) res = res / i ; for ( int i = 1 ; i <= b ; i ++ ) res = res / i ; return res ; } static void Ksmallest ( int x , int y , int k ) { if ( x == 0 && y == 0 ) return ; else if ( x == 0 ) { y -- ; Console . Write ( " V " ) ; Ksmallest ( x , y , k ) ; } else if ( y == 0 ) { x -- ; Console . Write ( " H " ) ; Ksmallest ( x , y , k ) ; } else { if ( factorial ( x - 1 , y ) > k ) { Console . Write ( " H " ) ; Ksmallest ( x - 1 , y , k ) ; } else { Console . Write ( " V " ) ; Ksmallest ( x , y - 1 , k - factorial ( x - 1 , y ) ) ; } } } public static void Main ( String [ ] args ) { int x = 2 , y = 2 , k = 2 ; Ksmallest ( x , y , k ) ; } }

Accumulator variables: i, x, y
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int centered_pentagonal_Num ( int n ) { return ( 5 * n * n - 5 * n + 2 ) / 2 ; } public static void Main ( ) { int n = 7 ; Console . Write ( n + " th ▁ Centered ▁ " + " pentagonal ▁ number : ▁ " ) ; Console . WriteLine ( centered_pentagonal_Num ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int pivotDis ( int x0 , int y0 , int x1 , int y1 ) { return ( int ) Math . Sqrt ( ( x1 - x0 ) * ( x1 - x0 ) + ( y1 - y0 ) * ( y1 - y0 ) ) ; } static int minDis ( int D , int r1 , int r2 ) { return Math . Max ( ( D - r1 - r2 ) , 0 ) ; } static int maxDis ( int D , int r1 , int r2 ) { return D + r1 + r2 ; } public static void Main ( ) { int x0 = 0 , y0 = 0 , x1 = 8 , y1 = 0 , r1 = 4 , r2 = 5 ; int D = pivotDis ( x0 , y0 , x1 , y1 ) ; Console . WriteLine ( " Distance ▁ while ▁ " + " repulsion ▁ = ▁ " + maxDis ( D , r1 , r2 ) ) ; Console . WriteLine ( " Distance ▁ while ▁ " + " attraction ▁ = ▁ " + minDis ( D , r1 , r2 ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static double maximumValueOfF ( int R ) { return 4 * R * R + 0.25 ; } public static void Main ( ) { int R = 3 ; Console . WriteLine ( maximumValueOfF ( R ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void otherEndPoint ( int x1 , int y1 , int m1 , int m2 ) { float x2 = ( float ) ( 2 * m1 - x1 ) ; float y2 = ( float ) ( 2 * m2 - y1 ) ; Console . WriteLine ( " x2 ▁ = ▁ " + x2 + " , ▁ " + " y2 ▁ = ▁ " + y2 ) ; } public static void Main ( String [ ] args ) { int x1 = - 4 , y1 = - 1 , m1 = 3 , m2 = 5 ; otherEndPoint ( x1 , y1 , m1 , m2 ) ; } }

Class/struct names: GFG
C# program:
using System . Linq ; using System ; public class GFG { static void printRect ( int [ ] X , int [ ] Y , int n ) { int Xmax = X . Max ( ) ; int Xmin = X . Min ( ) ; int Ymax = Y . Max ( ) ; int Ymin = Y . Min ( ) ; Console . WriteLine ( " { " + Xmin + " , ▁ " + Ymin + " } " ) ; Console . WriteLine ( " { " + Xmin + " , ▁ " + Ymax + " } " ) ; Console . WriteLine ( " { " + Xmax + " , ▁ " + Ymax + " } " ) ; Console . WriteLine ( " { " + Xmax + " , ▁ " + Ymin + " } " ) ; } static public void Main ( ) { int [ ] X = { 4 , 3 , 6 , 1 , - 1 , 12 } ; int [ ] Y = { 4 , 1 , 10 , 3 , 7 , - 1 } ; int n = X . Length ; printRect ( X , Y , n ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static bool checkOrigin ( int x1 , int y1 , int x2 , int y2 ) { return ( x1 * ( y2 - y1 ) == y1 * ( x2 - x1 ) ) ; } public static void Main ( ) { if ( checkOrigin ( 1 , 28 , 2 , 56 ) == true ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static bool isBetween ( int a , int b , int c ) { return ( Math . Min ( a , b ) <= c && c <= Math . Max ( a , b ) ) ; } static bool canJoin ( int [ ] x , int [ ] y , int i , int j , int k ) { return ( x [ k ] == x [ i ] x [ k ] == x [ j ] ) && isBetween ( y [ i ] , y [ j ] , y [ k ] ) || ( y [ k ] == y [ i ] y [ k ] == y [ j ] ) && isBetween ( x [ i ] , x [ j ] , x [ k ] ) ; } static int countLineSegments ( int [ ] x , int [ ] y ) { if ( ( x [ 0 ] == x [ 1 ] && x [ 1 ] == x [ 2 ] ) || ( y [ 0 ] == y [ 1 ] && y [ 1 ] == y [ 2 ] ) ) return 1 ; else if ( canJoin ( x , y , 0 , 1 , 2 ) || canJoin ( x , y , 0 , 2 , 1 ) || canJoin ( x , y , 1 , 2 , 0 ) ) return 2 ; else return 3 ; } public static void Main ( ) { int [ ] x = new int [ 3 ] ; int [ ] y = new int [ 3 ] ; x [ 0 ] = - 1 ; y [ 0 ] = - 1 ; x [ 1 ] = - 1 ; y [ 1 ] = 3 ; x [ 2 ] = 4 ; y [ 2 ] = 3 ; Console . WriteLine ( countLineSegments ( x , y ) ) ; } }

Index/key variables: i, j, k
Class/struct names: GFG
C# program:
using System ; class GFG { static Boolean pythagorean_quadruple ( int a , int b , int c , int d ) { int sum = a * a + b * b + c * c ; if ( d * d == sum ) return true ; else return false ; } public static void Main ( ) { int a = 1 , b = 2 , c = 2 , d = 3 ; if ( pythagorean_quadruple ( a , b , c , d ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Class/struct names: GFG
C# program:
using System ; public class demo { static float pi = 3.14159f ; public static float volume ( float r , float R , float h ) { return ( float ) 1 / 3 * pi * h * ( r * r + R * R + r * R ) ; } public static float curved_surface_area ( float r , float R , float l ) { return pi * l * ( R + r ) ; } public static float total_surface_area ( float r , float R , float l , float h ) { return pi * l * ( R + r ) + pi * ( r * r + R * R ) ; } public static void Main ( ) { float small_radius = 3 ; float big_radius = 8 ; float slant_height = 13 ; float height = 12 ; Console . Write ( " Volume ▁ Of ▁ Frustum ▁ of ▁ Cone ▁ : ▁ " ) ; Console . WriteLine ( volume ( small_radius , big_radius , height ) ) ; Console . Write ( " Curved ▁ Surface ▁ Area ▁ Of " + " ▁ Frustum ▁ of ▁ Cone ▁ : ▁ " ) ; Console . WriteLine ( curved_surface_area ( small_radius , big_radius , slant_height ) ) ; Console . Write ( " Total ▁ Surface ▁ Area ▁ Of " + " ▁ Frustum ▁ of ▁ Cone ▁ : ▁ " ) ; Console . WriteLine ( total_surface_area ( small_radius , big_radius , slant_height , height ) ) ; } }

Class/struct names: demo
C# program:
using System ; class GFG { static int Circumference ( int a ) { return 4 * a ; } public static void Main ( ) { int a = 5 ; Console . WriteLine ( " Circumference " + " ▁ of ▁ a ▁ square ▁ is ▁ " + Circumference ( a ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static double maxArea ( double a , double b , double c , double d ) { double semiperimeter = ( a + b + c + d ) / 2 ; return Math . Sqrt ( ( semiperimeter - a ) * ( semiperimeter - b ) * ( semiperimeter - c ) * ( semiperimeter - d ) ) ; } public static void Main ( ) { double a = 1 , b = 2 , c = 1 , d = 2 ; Console . WriteLine ( maxArea ( a , b , c , d ) ) ; } }

Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { public class point { public int x , y ; } ; static int RIGHT = 1 , LEFT = - 1 , ZERO = 0 ; static int directionOfPoint ( point A , point B , point P ) { B . x -= A . x ; B . y -= A . y ; P . x -= A . x ; P . y -= A . y ; int cross_product = B . x * P . y - B . y * P . x ; if ( cross_product > 0 ) return RIGHT ; if ( cross_product < 0 ) return LEFT ; return ZERO ; } public static void Main ( String [ ] args ) { point A = new point ( ) , B = new point ( ) , P = new point ( ) ; A . x = - 30 ; B . x = 29 ; P . x = 15 ; int direction = directionOfPoint ( A , B , P ) ; if ( direction == 1 ) Console . WriteLine ( " Right ▁ Direction " ) ; else if ( direction == - 1 ) Console . WriteLine ( " Left ▁ Direction " ) ; else Console . WriteLine ( " Point ▁ is ▁ on ▁ the ▁ Line " ) ; } }

Accumulator variables: x, y
Class/struct names: GFG, point
C# program:
using System ; class GFG { static int minRadius ( int k , int [ ] x , int [ ] y , int n ) { int [ ] dis = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) dis [ i ] = x [ i ] * x [ i ] + y [ i ] * y [ i ] ; Array . Sort ( dis ) ; return dis [ k - 1 ] ; } public static void Main ( ) { int k = 3 ; int [ ] x = { 1 , - 1 , 1 } ; int [ ] y = { 1 , - 1 , - 1 } ; int n = x . Length ; Console . WriteLine ( minRadius ( k , x , y , n ) ) ; } }

Index/key variables: i, n
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int areaRectangle ( int a , int b ) { int area = a * b ; return area ; } static int perimeterRectangle ( int a , int b ) { int perimeter = 2 * ( a + b ) ; return perimeter ; } public static void Main ( ) { int a = 5 ; int b = 6 ; Console . WriteLine ( " Area ▁ = ▁ " + areaRectangle ( a , b ) ) ; Console . WriteLine ( " Perimeter ▁ = ▁ " + perimeterRectangle ( a , b ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int areaSquare ( int side ) { int area = side * side ; return area ; } public static void Main ( ) { int side = 4 ; Console . WriteLine ( areaSquare ( side ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { public static long minPerimeter ( int n ) { int l = ( int ) Math . Sqrt ( n ) ; int sq = l * l ; if ( sq == n ) return l * 4 ; else { long row = n / l ; long perimeter = 2 * ( l + row ) ; if ( n % l != 0 ) perimeter += 2 ; return perimeter ; } } public static void Main ( ) { int n = 10 ; Console . Write ( minPerimeter ( n ) ) ; } }

Accumulator variables: perimeter
Class/struct names: GFG
C# program:
using System ; class GFG { static void possibleOrNot ( long a1 , long a2 , long b1 , long b2 , long c1 , long c2 ) { long dis1 = ( long ) Math . Pow ( b1 - a1 , 2 ) + ( long ) Math . Pow ( b2 - a2 , 2 ) ; long dis2 = ( long ) Math . Pow ( c1 - b1 , 2 ) + ( long ) Math . Pow ( c2 - b2 , 2 ) ; if ( dis1 != dis2 ) Console . Write ( " No " ) ; else if ( b1 == ( ( a1 + c1 ) / 2.0 ) && b2 == ( ( a2 + c2 ) / 2.0 ) ) Console . Write ( " No " ) ; else Console . Write ( " Yes " ) ; } public static void Main ( ) { long a1 = 1 , a2 = 0 , b1 = 2 , b2 = 0 , c1 = 3 , c2 = 0 ; possibleOrNot ( a1 , a2 , b1 , b2 , c1 , c2 ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int circle ( int x1 , int y1 , int x2 , int y2 , int r1 , int r2 ) { int distSq = ( x1 - x2 ) * ( x1 - x2 ) + ( y1 - y2 ) * ( y1 - y2 ) ; int radSumSq = ( r1 + r2 ) * ( r1 + r2 ) ; if ( distSq == radSumSq ) return 1 ; else if ( distSq > radSumSq ) return - 1 ; else return 0 ; } public static void Main ( ) { int x1 = - 10 , y1 = 8 ; int x2 = 14 , y2 = - 24 ; int r1 = 30 , r2 = 10 ; int t = circle ( x1 , y1 , x2 , y2 , r1 , r2 ) ; if ( t == 1 ) Console . WriteLine ( " Circle ▁ touch " + " ▁ to ▁ each ▁ other . " ) ; else if ( t < 0 ) Console . WriteLine ( " Circle ▁ not ▁ touch " + " ▁ to ▁ each ▁ other . " ) ; else Console . WriteLine ( " Circle ▁ intersect " + " ▁ to ▁ each ▁ other . " ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int countObtuseAngles ( int a , int b , int k ) { int c1 = ( b - a ) - 1 ; int c2 = ( k - b ) + ( a - 1 ) ; if ( c1 == c2 ) return 0 ; return Math . Min ( c1 , c2 ) ; } public static void Main ( ) { int k = 6 , a = 1 , b = 3 ; Console . WriteLine ( countObtuseAngles ( a , b , k ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { public class Point { public float x , y ; public Point ( ) { x = y = 0 ; } public Point ( float a , float b ) { x = a ; y = b ; } } ; static void printPoints ( Point source , float l , int m ) { Point a = new Point ( ) ; Point b = new Point ( ) ; if ( m == 0 ) { a . x = source . x + l ; a . y = source . y ; b . x = source . x - l ; b . y = source . y ; } else if ( Double . IsInfinity ( m ) ) { a . x = source . x ; a . y = source . y + l ; b . x = source . x ; b . y = source . y - l ; } else { float dx = ( float ) ( l / Math . Sqrt ( 1 + ( m * m ) ) ) ; float dy = m * dx ; a . x = source . x + dx ; a . y = source . y + dy ; b . x = source . x - dx ; b . y = source . y - dy ; } Console . WriteLine ( a . x + " , ▁ " + a . y ) ; Console . WriteLine ( b . x + " , ▁ " + b . y ) ; } public static void Main ( String [ ] args ) { Point p = new Point ( 2 , 1 ) , q = new Point ( 1 , 0 ) ; printPoints ( p , ( float ) Math . Sqrt ( 2 ) , 1 ) ; Console . WriteLine ( ) ; printPoints ( q , 5 , 0 ) ; } }

Class/struct names: GFG, Point
C# program:
using System ; class GFG { class point { public int x , y ; public point ( int x , int y ) { this . x = x ; this . y = y ; } } ; class line { public int a , b , c ; line ( ) { } public line ( int a , int b , int c ) { this . a = a ; this . b = b ; this . c = c ; } } ; static int evalPointOnLine ( point p , line curLine ) { int eval = curLine . a * p . x + curLine . b * p . y + curLine . c ; if ( eval > 0 ) return 1 ; return - 1 ; } static int minJumpToReachDestination ( point start , point dest , line [ ] lines , int N ) { int jumps = 0 ; for ( int i = 0 ; i < N ; i ++ ) { int signStart = evalPointOnLine ( start , lines [ i ] ) ; int signDest = evalPointOnLine ( dest , lines [ i ] ) ; if ( signStart * signDest < 0 ) jumps ++ ; } return jumps ; } public static void Main ( String [ ] args ) { point start = new point ( 1 , 1 ) ; point dest = new point ( - 2 , - 1 ) ; line [ ] lines = new line [ 3 ] ; lines [ 0 ] = new line ( 1 , 0 , 0 ) ; lines [ 1 ] = new line ( 0 , 1 , 0 ) ; lines [ 2 ] = new line ( 1 , 1 , - 2 ) ; Console . Write ( minJumpToReachDestination ( start , dest , lines , 3 ) ) ; } }

Index/key variables: i
Accumulator variables: i, jumps
Iterator variables: i
Class/struct names: GFG, line, point
C# program:
using System ; class GFG { public class Interval { public int start , end ; public Interval ( int start , int end ) { this . start = start ; this . end = end ; } } ; static int minDistanceToCoverIntervals ( Interval [ ] intervals , int N , int x ) { int rightMostStart = int . MinValue ; int leftMostEnd = int . MaxValue ; for ( int i = 0 ; i < N ; i ++ ) { if ( rightMostStart < intervals [ i ] . start ) rightMostStart = intervals [ i ] . start ; if ( leftMostEnd > intervals [ i ] . end ) leftMostEnd = intervals [ i ] . end ; } int res ; if ( rightMostStart > leftMostEnd ) res = - 1 ; else if ( rightMostStart <= x && x <= leftMostEnd ) res = 0 ; else res = ( x < rightMostStart ) ? ( rightMostStart - x ) : ( x - leftMostEnd ) ; return res ; } public static void Main ( String [ ] args ) { int x = 3 ; Interval [ ] intervals = { new Interval ( 0 , 7 ) , new Interval ( 2 , 14 ) , new Interval ( 4 , 6 ) } ; int N = intervals . Length ; int res = minDistanceToCoverIntervals ( intervals , N , x ) ; if ( res == - 1 ) Console . Write ( " Not ▁ Possible ▁ to ▁ " + " cover ▁ all ▁ intervals STRNEWLINE " ) ; else Console . Write ( res + " STRNEWLINE " ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG, Interval
C# program:
using System ; class GFG { static void findTriangle ( int [ ] a , int n ) { int [ ] b = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) b [ i ] = a [ i ] * a [ i ] ; Array . Sort ( a ) ; Array . Sort ( b ) ; int x = 0 , y = 0 , z = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int p = i + 1 ; int q = i + 1 ; for ( int j = i + 1 ; j < n ; j ++ ) { while ( p < n - 1 && b [ i ] + b [ j ] >= b [ p + 1 ] ) p ++ ; q = Math . Max ( q , p ) ; while ( q < n - 1 && a [ i ] + a [ j ] > a [ q + 1 ] ) q ++ ; if ( b [ i ] + b [ j ] == b [ p ] ) { x += Math . Max ( p - j - 1 , 0 ) ; y ++ ; z += q - p ; } else { x += Math . Max ( p - j , 0 ) ; z += q - p ; } } } Console . Write ( " Acute ▁ Triangle : ▁ " + x + " STRNEWLINE " ) ; Console . Write ( " Right ▁ Triangle : ▁ " + y + " STRNEWLINE " ) ; Console . Write ( " Obtuse ▁ Triangle : ▁ " + z + " STRNEWLINE " ) ; } public static void Main ( string [ ] args ) { int [ ] arr = { 2 , 3 , 9 , 10 , 12 , 15 } ; int n = arr . Length ; findTriangle ( arr , n ) ; } }

Index/key variables: i, j, n, p
Accumulator variables: i, j, p, q, x, y, z
Iterator variables: i, j
Class/struct names: GFG