codeparrot/xlcost-text-to-code huggingface dataset:
Determine position of two points with respect to a 3D plane | C # program for the above approach ; Function to check position of two points with respect to a plane in 3D ; Put coordinates in plane equation ; If both values have same sign ; If both values have different sign ; If both values are zero ; If either of the two values is zero ; Driver code ; Given Input ; Coordinates of points ; Function Call
using System ; class GFG { static void check_position ( int a , int b , int c , int d , int x1 , int y1 , int z1 , int x2 , int y2 , int z2 ) { int value_1 = a * x1 + b * y1 + c * z1 + d ; int value_2 = a * x2 + b * y2 + c * z2 + d ; if ( ( value_1 > 0 && value_2 > 0 ) || ( value_1 < 0 && value_2 < 0 ) ) Console . Write ( " On ▁ same ▁ side " ) ; if ( ( value_1 > 0 && value_2 < 0 ) || ( value_1 < 0 && value_2 > 0 ) ) Console . Write ( " On ▁ different ▁ sides " ) ; if ( value_1 == 0 && value_2 == 0 ) Console . Write ( " Both ▁ on ▁ the ▁ plane " ) ; if ( value_1 == 0 && value_2 != 0 ) Console . Write ( " Point ▁ 1 ▁ on ▁ the ▁ plane " ) ; if ( value_1 != 0 && value_2 == 0 ) Console . Write ( " Point ▁ 2 ▁ on ▁ the ▁ plane " ) ; } static void Main ( ) { int a = 1 , b = 2 , c = 3 , d = 4 ; int x1 = - 2 , y1 = - 2 , z1 = 1 ; int x2 = - 4 , y2 = 11 , z2 = - 1 ; check_position ( a , b , c , d , x1 , y1 , z1 , x2 , y2 , z2 ) ; } }
Check if any pair of semicircles intersect or not | C # program for the above approach ; Function to check if any pairs of the semicircles intersects or not ; Stores the coordinates of all the semicircles ; x and y are coordinates ; Store the minimum and maximum value of the pair ; Push the pair in vector ; Compare one pair with other pairs ; Generating the second pair ; Extract all the second pairs one by one ; 1 st condition ; 2 nd condition ; If any one condition is true ; If any pair of semicircles doesn 't exists ; Driver Code
using System ; using System . Collections . Generic ; class GFG { class pair { public int first , second ; public pair ( int first , int second ) { this . first = first ; this . second = second ; } } static bool checkIntersection ( int [ ] arr , int N ) { List < pair > vec = new List < pair > ( ) ; for ( int i = 0 ; i < N - 1 ; i ++ ) { int x = arr [ i ] , y = arr [ i + 1 ] ; int minn = Math . Min ( x , y ) ; int maxx = Math . Max ( x , y ) ; vec . Add ( new pair ( minn , maxx ) ) ; } for ( int i = 0 ; i < vec . Count ; i ++ ) { pair x = vec [ i ] ; for ( int j = 0 ; j < vec . Count ; j ++ ) { pair y = vec [ j ] ; bool cond1 = ( x . first < y . first && x . second < y . second && y . first < x . second ) ; bool cond2 = ( y . first < x . first && y . second < x . second && x . first < y . second ) ; if ( cond1 cond2 ) { return true ; } } } return false ; } public static void Main ( String [ ] args ) { int [ ] arr = { 0 , 15 , 5 , 10 } ; int N = arr . Length ; if ( checkIntersection ( arr , N ) ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } }
Find the angle between tangents drawn from a given external point to a Circle | C # program for the above approach ; Function to find the distance between center and the exterior point ; Find the difference between the x and y coordinates ; Using the distance formula ; Function to find the angle between the pair of tangents drawn from the point ( X2 , Y2 ) to the circle . ; Calculate the distance between the center and exterior point ; Invalid Case ; Find the angle using the formula ; Print the resultant angle ; Driver code
using System ; class GFG { static double point_distance ( int x1 , int y1 , int x2 , int y2 ) { int p = ( x2 - x1 ) ; int q = ( y2 - y1 ) ; double distance = Math . Sqrt ( p * p + q * q ) ; return distance ; } static void tangentAngle ( int x1 , int y1 , int x2 , int y2 , double radius ) { double distance = point_distance ( x1 , y1 , x2 , y2 ) ; if ( radius / distance > 1 radius / distance < - 1 ) { Console . WriteLine ( - 1 ) ; } double result = 2 * Math . Asin ( radius / distance ) * 180 / 3.1415 ; Console . WriteLine ( String . Format ( " { 0:0.0000 } " , result ) + " ▁ degrees " ) ; } static void Main ( ) { int radius = 4 ; int x1 = 7 , y1 = 12 ; int x2 = 3 , y2 = 4 ; tangentAngle ( x1 , y1 , x2 , y2 , radius ) ; } }
Ratio of area of two nested polygons formed by connecting midpoints of sides of a regular N | C # program for the above approach ; Function to calculate the ratio of area of N - th and ( N + 1 ) - th nested polygons formed by connecting midpoints ; Stores the value of PI ; Calculating area the factor ; Printing the ratio precise upto 6 decimal places ; Driver Code
using System ; using System . Collections . Generic ; class GFG { static void AreaFactor ( int n ) { double pi = 3.14159265 ; double areaf = 1 / ( Math . Cos ( pi / n ) * Math . Cos ( pi / n ) ) ; Console . WriteLine ( Math . Round ( areaf ) ) ; } public static void Main ( string [ ] args ) { int n = 4 ; AreaFactor ( n ) ; } }
Find the length of Kth N | C # program for the above approach ; Function to calculate the interior angle of a N - sided regular polygon ; Function to find the K - th polygon formed inside the ( K - 1 ) th polygon ; Stores the interior angle ; Stores the side length of K - th regular polygon ; Return the length ; Driver Code
using System ; class GFG { static readonly double PI = 3.14159265 ; static double findInteriorAngle ( int n ) { return ( ( n - 2 ) * PI ) / n ; } static double calculateSideLength ( double L , int N , int K ) { double angle = findInteriorAngle ( N ) ; double length = L * Math . Pow ( Math . Sin ( angle / 2 ) , ( K - 1 ) ) ; return length ; } public static void Main ( String [ ] args ) { double L = 21 ; int N = 5 , K = 7 ; Console . Write ( calculateSideLength ( L , N , K ) ) ; } }
Angle between a Pair of Lines | C # program for the above approach ; Function to find the angle between two lines ; Store the tan value of the angle ; Calculate tan inverse of the angle ; Convert the angle from radian to degree ; Print the result ; Driver Code
using System ; class GFG { static double PI = 3.14159265 ; static void findAngle ( double M1 , double M2 ) { double angle = Math . Abs ( ( M2 - M1 ) / ( 1 + M1 * M2 ) ) ; double ret = Math . Atan ( angle ) ; double val = ( ret * 180 ) / PI ; Console . Write ( val ) ; } public static void Main ( ) { double M1 = 1.75 , M2 = 0.27 ; findAngle ( M1 , M2 ) ; } }
Angle of intersection of two circles having their centers D distance apart | C # program for the above approach ; Function to find the cosine of the angle of the intersection of two circles with radius R1 and R2 ; Return the cosine of the angle ; Driver Code
using System ; class GFG { static float angle ( float R1 , float R2 , float D ) { float ans = ( R1 * R1 + R2 * R2 - D * D ) / ( 2 * R1 * R2 ) ; return ans ; } public static void Main ( string [ ] args ) { float R1 = 3 , R2 = 4 ; float D = 5 ; Console . Write ( angle ( R1 , R2 , D ) ) ; } }
Check if any point exists in a plane whose Manhattan distance is at most K from N given points | C # program for the above approach ; Function to check if there exists any point with at most K distance from N given points ; Traverse the given N points ; Stores the count of pairs of coordinates having Manhattan distance <= K ; For the same coordinate ; Calculate Manhattan distance ; If Manhattan distance <= K ; If all coordinates can meet ; If all coordinates can 't meet ; Driver Code
using System ; class GFG { public static String find ( int [ ] a , int [ ] b , int N , int K ) { for ( int i = 0 ; i < N ; i ++ ) { int count = 0 ; for ( int j = 0 ; j < N ; j ++ ) { if ( i == j ) { continue ; } long dis = Math . Abs ( a [ i ] - a [ j ] ) + Math . Abs ( b [ i ] - b [ j ] ) ; if ( dis <= K ) { count ++ ; } if ( count == N - 1 ) { return " Yes " ; } } } return " No " ; } public static void Main ( string [ ] args ) { int N = 5 ; int [ ] A = { 1 , 0 , 2 , 1 , 1 } ; int [ ] B = { 1 , 1 , 1 , 0 , 2 } ; int K = 1 ; Console . WriteLine ( find ( A , B , N , K ) ) ; } }
Minimum area of the triangle formed by any tangent to an ellipse with the coordinate axes | C # program for the above approach ; Function to find the minimum area of triangle formed by any tangent to ellipse with the coordinate axes ; Stores the minimum area ; Print the calculated area ; Driver Code
using System ; class GFG { static void minimumTriangleArea ( int a , int b ) { int area = a * b ; Console . WriteLine ( area ) ; } public static void Main ( ) { int a = 1 , b = 2 ; minimumTriangleArea ( a , b ) ; } }
Find interior angles for each side of a given Cyclic Quadrilateral | C # program for the above approach ; Function to find the interior angles of the cyclic quadrilateral ; Stores the numerator and the denominator to find angle A ; Stores the numerator and the denominator to find angle B ; Stores the numerator and the denominator to find angle C : ; Stores the numerator and the denominator to find angle D : ; Driver Code
using System ; class GFG { static void findAngles ( double a , double b , double c , double d ) { double numerator = a * a + d * d - b * b - c * c ; double denominator = 2 * ( a * b + c * d ) ; double x = numerator / denominator ; Console . WriteLine ( " A : ▁ " + Math . Round ( ( ( Math . Acos ( x ) * 180 ) / 3.141592 ) * 100.0 ) / 100.0 + " ▁ degrees " ) ; numerator = a * a + b * b - c * c - d * d ; x = numerator / denominator ; Console . WriteLine ( " B : ▁ " + Math . Round ( ( ( Math . Acos ( x ) * 180 ) / 3.141592 ) * 100.0 ) / 100.0 + " ▁ degrees " ) ; numerator = c * c + b * b - a * a - d * d ; x = numerator / denominator ; Console . WriteLine ( " C : ▁ " + Math . Round ( ( ( Math . Acos ( x ) * 180 ) / 3.141592 ) * 100.0 ) / 100.0 + " ▁ degrees " ) ; numerator = d * d + c * c - a * a - b * b ; x = numerator / denominator ; Console . WriteLine ( " D : ▁ " + Math . Round ( ( ( Math . Acos ( x ) * 180 ) / 3.141592 ) * 100.0 ) / 100.0 + " ▁ degrees " ) ; } public static void Main ( string [ ] args ) { double A = 10 , B = 15 , C = 20 , D = 25 ; findAngles ( A , B , C , D ) ; } }
Number of smaller circles that can be inscribed in a larger circle | C # program for the above approach ; Function to count number of smaller circles that can be inscribed in the larger circle touching its boundary ; If R2 is greater than R1 ; Stores the angle made by the smaller circle ; Stores the ratio of R2 / ( R1 - R2 ) ; Stores the count of smaller circles that can be inscribed ; Stores the ratio ; If the diameter of smaller circle is greater than the radius of the larger circle ; Otherwise ; Find the angle using formula ; Divide 360 with angle and take the floor value ; Return the final result ; Driver Code
using System ; class GFG { static int countInscribed ( int R1 , int R2 ) { if ( R2 > R1 ) return 0 ; double angle ; double ratio ; int number_of_circles = 0 ; ratio = R2 / ( double ) ( R1 - R2 ) ; if ( R1 < 2 * R2 ) { number_of_circles = 1 ; } else { angle = Math . Abs ( Math . Asin ( ratio ) * 180 ) / 3.14159265 ; number_of_circles = ( int ) ( 360 / ( 2 * Math . Floor ( angle ) ) ) ; } return number_of_circles ; } public static void Main ( ) { int R1 = 3 ; int R2 = 1 ; Console . WriteLine ( countInscribed ( R1 , R2 ) ) ; } }
Count pairs of coordinates connected by a line with slope in the range [ | C # program for the above approach ; Function to find the number of pairs of points such that the line passing through them has a slope in the range [ - k , k ] ; Store the result ; Traverse through all the combination of points ; If pair satisfies the given condition ; Increment ans by 1 ; Print the result ; Driver Code ; Function Call
using System ; class GFG { static void findPairs ( int [ ] x , int [ ] y , int K ) { int n = x . Length ; int ans = 0 ; for ( int i = 0 ; i < n ; ++ i ) { for ( int j = i + 1 ; j < n ; ++ j ) { if ( K * Math . Abs ( x [ i ] - x [ j ] ) >= Math . Abs ( y [ i ] - y [ j ] ) ) { ++ ans ; } } } Console . WriteLine ( ans ) ; } public static void Main ( String [ ] args ) { int [ ] X = { 2 , 1 , 0 } ; int [ ] Y = { 1 , 2 , 0 } ; int K = 1 ; findPairs ( X , Y , K ) ; } }
Number of largest circles that can be inscribed in a rectangle | C # program to implement the above approach ; Function to count the number of largest circles in a rectangle ; If length exceeds breadth ; Swap to reduce length to smaller than breadth ; Return total count of circles inscribed ; Driver Code
using System ; public class GFG { static int totalCircles ( int L , int B ) { if ( L > B ) { int temp = L ; L = B ; B = temp ; } return B / L ; } public static void Main ( String [ ] args ) { int L = 3 ; int B = 8 ; Console . Write ( totalCircles ( L , B ) ) ; } }
Program to calculate length of diagonal of a square | C # program for the above approach ; Function to find the length of the diagonal of a square of a given side ; Driver Code
using System ; public class GFG { static double findDiagonal ( double s ) { return ( double ) Math . Sqrt ( 2 ) * s ; } public static void Main ( String [ ] args ) { double S = 10 ; Console . Write ( findDiagonal ( S ) ) ; } }
Area of largest isosceles triangle that can be inscribed in an Ellipse whose vertex coincides with one extremity of the major axis | C # program for the above approach ; Function to calculate area of the isosceles triangle ; If a and b are negative ; Stores the area of the triangle ; Print the area ; Driver Code ; Given value of a & b ; Function call to find the area of the isosceles triangle
using System ; public class GFG { static void triangleArea ( float a , float b ) { if ( a < 0 b < 0 ) { Console . WriteLine ( - 1 ) ; return ; } float area = ( 3 * ( float ) Math . Sqrt ( 3 ) * a * b ) / ( 4 ) ; Console . WriteLine ( area ) ; } public static void Main ( string [ ] args ) { float a = 1 , b = 2 ; triangleArea ( a , b ) ; } }
Queries to count points lying on or inside an isosceles Triangle with given length of equal sides | C # implementation of above approach ; Function to find answer of each query ; Stores the count of points with sum less than or equal to their indices ; Traverse the array ; If both x and y - coordinate < 0 ; Stores the sum of co - ordinates ; Increment count of sum by 1 ; Prefix array ; Perform queries ; Drivers Code
using System ; public class GFG { static int MAX = ( int ) ( 1e6 + 5 ) ; static void query ( double [ , ] arr , int [ ] Q ) { int [ ] pre = new int [ MAX ] ; for ( int i = 0 ; i < arr . GetLength ( 0 ) ; i ++ ) { if ( arr [ i , 0 ] < 0 arr [ i , 1 ] < 0 ) continue ; int sum = ( int ) Math . Ceiling ( ( arr [ i , 0 ] + arr [ i , 1 ] ) ) ; pre [ sum ] ++ ; } for ( int i = 1 ; i < MAX ; i ++ ) pre [ i ] += pre [ i - 1 ] ; for ( int i = 0 ; i < Q . Length ; i ++ ) { Console . Write ( pre [ Q [ i ] ] + " ▁ " ) ; } Console . WriteLine ( ) ; } public static void Main ( String [ ] args ) { double [ , ] arr = { { 2.1 , 3.0 } , { 3.7 , 1.2 } , { 1.5 , 6.5 } , { 1.2 , 0.0 } } ; int [ ] Q = { 2 , 8 , 5 } ; int N = arr . GetLength ( 0 ) ; int M = Q . Length ; query ( arr , Q ) ; } }
Perimeter of the Union of Two Rectangles | C # program for the above approach ; Function to check if two rectangles are intersecting or not ; If one rectangle is to the right of other 's right edge ; If one rectangle is on the top of other 's top edge ; Function to return the perimeter of the Union of Two Rectangles ; Stores the resultant perimeter ; If rectangles do not interesect ; Perimeter of Rectangle 1 ; Perimeter of Rectangle 2 ; If the rectangles intersect ; Get width of combined figure ; Get length of combined figure ; Return the perimeter ; Driver Code
using System ; using System . Linq ; public class GFG { static bool doIntersect ( int [ ] X , int [ ] Y ) { if ( X [ 0 ] > X [ 3 ] X [ 2 ] > X [ 1 ] ) return false ; if ( Y [ 0 ] > Y [ 3 ] Y [ 2 ] > Y [ 1 ] ) return false ; return true ; } static int getUnionPerimeter ( int [ ] X , int [ ] Y ) { int perimeter = 0 ; if ( ! doIntersect ( X , Y ) ) { perimeter += 2 * ( Math . Abs ( X [ 1 ] - X [ 0 ] ) + Math . Abs ( Y [ 1 ] - Y [ 0 ] ) ) ; perimeter += 2 * ( Math . Abs ( X [ 3 ] - X [ 2 ] ) + Math . Abs ( Y [ 3 ] - Y [ 2 ] ) ) ; } else { int w = X . Max ( ) - X . Min ( ) ; int l = X . Max ( ) - Y . Min ( ) ; perimeter = 2 * ( l + w ) ; } return perimeter ; } public static void Main ( String [ ] args ) { int [ ] X = { - 1 , 2 , 4 , 6 } ; int [ ] Y = { 2 , 5 , 3 , 7 } ; Console . Write ( getUnionPerimeter ( X , Y ) ) ; } }
Check whether two straight lines are parallel or not | C # program to implement the above approach ; Function to check if two lines are parallel or not ; If slopes are equal ; Driver Code ; Function Call
using System ; class GFG { static void parallel ( float a1 , float b1 , float c1 , float a2 , float b2 , float c2 ) { if ( ( - ( a1 / b1 ) ) == ( - ( a2 / b2 ) ) ) { Console . Write ( " Yes " ) ; } else { Console . Write ( " No " ) ; } } public static void Main ( ) { float a1 = - 2 , b1 = 4 , c1 = 5 ; float a2 = - 6 , b2 = 12 , c2 = 6 ; parallel ( a1 , b1 , c1 , a2 , b2 , c2 ) ; } }
Calculate area and height of an isosceles triangle whose sides are radii of a circle | C # program for the above approach ; Function to convert given angle from degree to radian ; Function to calculate height and area of the triangle OAB ; Stores the angle OAB and OBA ; Stores the angle in radians ; Stores the height ; Print height of the triangle ; Stores the base of triangle OAB ; Stores the area of the triangle ; Print the area of triangle OAB ; Driver Code
using System ; public class GFG { static double Convert ( double degree ) { double pi = 3.14159265359 ; return ( degree * ( pi / 180 ) ) ; } static void areaAndHeightOfTraingle ( double radius , double a ) { if ( a >= 180 a == 0 ) { Console . WriteLine ( " Not ▁ possible " ) ; return ; } double base_angle = ( 180 - a ) / 2 ; double radians = Convert ( base_angle ) ; double height = Math . Sin ( radians ) * radius ; Console . WriteLine ( " Height ▁ of ▁ triangle ▁ " + height ) ; double Base = Math . Cos ( radians ) * radius ; double area = Base * height ; Console . WriteLine ( " Area ▁ of ▁ triangle ▁ " + area ) ; } static public void Main ( ) { double R = 5 , angle = 120 ; areaAndHeightOfTraingle ( R , angle ) ; } }
Radius of a circle having area equal to the sum of area of the circles having given radii | C # program to implement the above approach ; Function to calculate radius of the circle having area equal to sum of the area of two circles with given radii ; Area of first circle ; Area of second circle ; Area of third circle ; Radius of third circle ; Driver code ; Given radius ; Prints the radius of the required circle
using System ; class GFG { static double findRadius ( double r1 , double r2 ) { double a1 , a2 , a3 , r3 ; a1 = 3.14 * r1 * r1 ; a2 = 3.14 * r2 * r2 ; a3 = a1 + a2 ; r3 = Math . Sqrt ( a3 / 3.14 ) ; return r3 ; } static void Main ( ) { double r1 = 8 , r2 = 6 ; Console . WriteLine ( ( int ) findRadius ( r1 , r2 ) ) ; } }
Minimum number of Cuboids required to form a Cube | C # program for the above approach ; Function to calculate and return LCM of a , b , and c ; Find GCD of a and b ; Find LCM of a and b ; LCM ( a , b , c ) = LCM ( LCM ( a , b ) , c ) ; Finding LCM of a , b , c ; return LCM ( a , b , c ) ; Function to find the minimum number of cuboids required to make the volume of a valid cube ; Find the LCM of L , B , H ; Volume of the cube ; Volume of the cuboid ; Minimum number cuboids required to form a cube ; Driver Code ; Given dimensions of cuboid ; Function Call
using System ; class GFG { static int find_lcm ( int a , int b , int c ) { int g = __gcd ( a , b ) ; int LCM1 = ( a * b ) / g ; g = __gcd ( LCM1 , c ) ; int LCM = ( LCM1 * c ) / g ; return LCM ; } static void minimumCuboids ( int L , int B , int H ) { int lcm = find_lcm ( L , B , H ) ; int volume_cube = lcm * lcm * lcm ; int volume_cuboid = L * B * H ; Console . Write ( ( volume_cube / volume_cuboid ) ) ; } static int __gcd ( int a , int b ) { return b == 0 ? a : __gcd ( b , a % b ) ; } public static void Main ( String [ ] args ) { int L = 1 , B = 1 , H = 2 ; minimumCuboids ( L , B , H ) ; } }
Check if given polygon is a convex polygon or not | C # program to implement the above approach ; Utility function to find cross product of two vectors ; Stores coefficient of X direction of vector A [ 1 ] A [ 0 ] ; Stores coefficient of Y direction of vector A [ 1 ] A [ 0 ] ; Stores coefficient of X direction of vector A [ 2 ] A [ 0 ] ; Stores coefficient of Y direction of vector A [ 2 ] A [ 0 ] ; Return cross product ; Function to check if the polygon is convex polygon or not ; Stores count of edges in polygon ; Stores direction of cross product of previous traversed edges ; Stores direction of cross product of current traversed edges ; Traverse the array ; Stores three adjacent edges of the polygon ; Update curr ; If curr is not equal to 0 ; If direction of cross product of all adjacent edges are not same ; Update curr ; Driver code
using System ; class GFG { static int CrossProduct ( int [ , ] A ) { int X1 = ( A [ 1 , 0 ] - A [ 0 , 0 ] ) ; int Y1 = ( A [ 1 , 1 ] - A [ 0 , 1 ] ) ; int X2 = ( A [ 2 , 0 ] - A [ 0 , 0 ] ) ; int Y2 = ( A [ 2 , 1 ] - A [ 0 , 1 ] ) ; return ( X1 * Y2 - Y1 * X2 ) ; } static bool isConvex ( int [ , ] points ) { int N = points . GetLength ( 0 ) ; int prev = 0 ; int curr = 0 ; for ( int i = 0 ; i < N ; i ++ ) { int [ ] temp1 = GetRow ( points , i ) ; int [ ] temp2 = GetRow ( points , ( i + 1 ) % N ) ; int [ ] temp3 = GetRow ( points , ( i + 2 ) % N ) ; int [ , ] temp = new int [ points . GetLength ( 0 ) , points . GetLength ( 1 ) ] ; temp = newTempIn ( points , temp1 , temp2 , temp3 ) ; curr = CrossProduct ( temp ) ; if ( curr != 0 ) { if ( curr * prev < 0 ) { return false ; } else { prev = curr ; } } } return true ; } public static int [ ] GetRow ( int [ , ] matrix , int row ) { var rowLength = matrix . GetLength ( 1 ) ; var rowVector = new int [ rowLength ] ; for ( var i = 0 ; i < rowLength ; i ++ ) rowVector [ i ] = matrix [ row , i ] ; return rowVector ; } public static int [ , ] newTempIn ( int [ , ] points , int [ ] row1 , int [ ] row2 , int [ ] row3 ) { int [ , ] temp = new int [ points . GetLength ( 0 ) , points . GetLength ( 1 ) ] ; for ( var i = 0 ; i < row1 . Length ; i ++ ) { temp [ 0 , i ] = row1 [ i ] ; temp [ 1 , i ] = row2 [ i ] ; temp [ 2 , i ] = row3 [ i ] ; } return temp ; } public static void Main ( String [ ] args ) { int [ , ] points = { { 0 , 0 } , { 0 , 1 } , { 1 , 1 } , { 1 , 0 } } ; if ( isConvex ( points ) ) { Console . WriteLine ( " Yes " ) ; } else { Console . WriteLine ( " No " ) ; } } }