dhyuti-n/xlcost-variable-roles huggingface dataset:
Java program:
import java . io . * ; class GFG { static int firstDigit ( int n ) { while ( n >= 10 ) { n /= 10 ; } return n ; } static int getCount ( int n ) { int count = 1 ; while ( n != 0 ) { int leadDigit = firstDigit ( n ) ; n -= leadDigit ; count ++ ; } return count ; } static int getLargestNumber ( int k ) { int left = k ; int right = k * 10 ; int mid = ( left + right ) / 2 ; int len = getCount ( mid ) ; while ( len != k ) { mid = ( left + right ) / 2 ; len = getCount ( mid ) ; if ( len > k ) { right = mid ; } else { left = mid ; } } while ( len == k ) { if ( len != getCount ( mid + 1 ) ) { break ; } mid ++ ; } return ( mid ) ; } public static void main ( String [ ] args ) { int k = 3 ; System . out . println ( getLargestNumber ( k ) ) ; } }

Accumulator variables: count, mid, n
Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static String checkReachability ( int N , int X , int Y ) { if ( X == 0 && Y == 0 ) { return " YES " ; } if ( N % 2 == 0 ) { return " YES " ; } else { if ( X % 2 != Y % 2 ) { return " NO " ; } else { return " YES " ; } } } public static void main ( String [ ] args ) { int N = 2 ; int X = 5 , Y = 4 ; System . out . println ( checkReachability ( N , X , Y ) ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static void closestsAngle ( int N , int A ) { double mi = Integer . MAX_VALUE ; int ans = 0 ; for ( int i = 1 ; i < N - 1 ; i ++ ) { double angle = 180.0 * i / N ; if ( Math . abs ( angle - A ) < Math . abs ( mi - A ) ) { mi = angle ; ans = i ; } } System . out . print ( 2 + " ▁ " + 1 + " ▁ " + ( 2 + ans ) ) ; } public static void main ( String [ ] args ) { int N = 3 , A = 15 ; closestsAngle ( N , A ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static double areaOftriangle ( int side ) { double a = Math . sqrt ( Math . pow ( side / 2 , 2 ) + Math . pow ( side / 2 , 2 ) ) ; double b = Math . sqrt ( Math . pow ( side , 2 ) + Math . pow ( side / 2 , 2 ) ) ; double c = Math . sqrt ( Math . pow ( side , 2 ) + Math . pow ( side / 2 , 2 ) ) ; double s = ( a + b + c ) / 2 ; double area = Math . sqrt ( s * ( s - a ) * ( s - b ) * ( s - c ) ) ; return area ; } public static void main ( String [ ] args ) { int N = 10 ; System . out . print ( areaOftriangle ( N ) ) ; } }

Class/struct names: GFG
Java program:
class GFG { static void findLine ( int distance , float degree ) { float x = ( float ) ( degree * 3.14159 / 180 ) ; if ( degree > 90 ) { System . out . print ( " Not ▁ Possible " ) ; return ; } float result_1 = ( float ) Math . sin ( x ) ; float result_2 = ( float ) Math . cos ( x ) ; System . out . print ( String . format ( " % .2f " , result_2 ) + " x ▁ + " + String . format ( " % .2f " , result_1 ) + " y ▁ = ▁ " + distance ) ; } public static void main ( String [ ] args ) { int D = 10 ; float A = 30 ; findLine ( D , A ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; import java . lang . * ; import java . util . * ; public class GFG { static int centralPoints ( int arr [ ] [ ] , int N ) { int count = 0 ; int c1 , c2 , c3 , c4 ; for ( int i = 0 ; i < N ; i ++ ) { c1 = 0 ; c2 = 0 ; c3 = 0 ; c4 = 0 ; int x = arr [ i ] [ 0 ] ; int y = arr [ i ] [ 1 ] ; for ( int j = 0 ; j < N ; j ++ ) { if ( arr [ j ] [ 0 ] > x && arr [ j ] [ 1 ] == y ) { c1 = 1 ; } if ( arr [ j ] [ 1 ] > y && arr [ j ] [ 0 ] == x ) { c2 = 1 ; } if ( arr [ j ] [ 0 ] < x && arr [ j ] [ 1 ] == y ) { c3 = 1 ; } if ( arr [ j ] [ 1 ] < y && arr [ j ] [ 0 ] == x ) { c4 = 1 ; } } if ( c1 + c2 + c3 + c4 == 4 ) { count ++ ; } } return count ; } public static void main ( String [ ] args ) { int arr [ ] [ ] = { { 1 , 0 } , { 2 , 0 } , { 1 , 1 } , { 1 , - 1 } } ; int N = arr . length ; System . out . println ( centralPoints ( arr , N ) ) ; } }

Index/key variables: i, j
Accumulator variables: count, i, j
Iterator variables: i, j
Class/struct names: GFG
Java program:
class GFG { static void finalPosition ( char [ ] a , int [ ] b , int M ) { int n = 0 , s = 0 , e = 0 , w = 0 ; char p = ' N ' ; for ( int i = 0 ; i < M ; i ++ ) { if ( p == ' N ' ) { if ( a [ i ] == ' U ' ) { p = ' N ' ; n = n + b [ i ] ; } else if ( a [ i ] == ' D ' ) { p = ' S ' ; s = s + b [ i ] ; } else if ( a [ i ] == ' R ' ) { p = ' E ' ; e = e + b [ i ] ; } else if ( a [ i ] == ' L ' ) { p = ' W ' ; w = w + b [ i ] ; } } else if ( p == ' S ' ) { if ( a [ i ] == ' U ' ) { p = ' S ' ; s = s + b [ i ] ; } else if ( a [ i ] == ' D ' ) { p = ' N ' ; n = n + b [ i ] ; } else if ( a [ i ] == ' R ' ) { p = ' W ' ; w = w + b [ i ] ; } else if ( a [ i ] == ' L ' ) { p = ' E ' ; e = e + b [ i ] ; } } else if ( p == ' E ' ) { if ( a [ i ] == ' U ' ) { p = ' E ' ; e = e + b [ i ] ; } else if ( a [ i ] == ' D ' ) { p = ' W ' ; w = w + b [ i ] ; } else if ( a [ i ] == ' R ' ) { p = ' S ' ; s = s + b [ i ] ; } else if ( a [ i ] == ' L ' ) { p = ' N ' ; n = n + b [ i ] ; } } else if ( p == ' W ' ) { if ( a [ i ] == ' U ' ) { p = ' W ' ; w = w + b [ i ] ; } else if ( a [ i ] == ' D ' ) { p = ' E ' ; e = e + b [ i ] ; } else if ( a [ i ] == ' R ' ) { p = ' N ' ; n = n + b [ i ] ; } else if ( a [ i ] == ' L ' ) { p = ' S ' ; s = s + b [ i ] ; } } } int ver_disp = n - s ; int hor_disp = e - w ; int displacement = ( int ) Math . ceil ( Math . sqrt ( ( ver_disp * ver_disp ) + ( hor_disp * hor_disp ) ) ) ; System . out . print ( displacement + " ▁ " + p ) ; } public static void main ( String args [ ] ) { char [ ] A = { ' U ' , ' R ' , ' R ' , ' R ' , ' R ' } ; int [ ] B = { 1 , 1 , 1 , 1 , 0 } ; int N = 1 ; finalPosition ( A , B , N ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static double lengthOfLatusRectum ( double A , double B ) { double major = 2.0 * A ; double minor = 2.0 * B ; double latus_rectum = ( minor * minor ) / major ; return latus_rectum ; } public static void main ( String [ ] args ) { double A = 3.0 , B = 2.0 ; System . out . print ( lengthOfLatusRectum ( A , B ) ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static void coneSlantHeight ( double cone_h , double cone_r ) { double slant_height_cone = Math . sqrt ( Math . pow ( cone_h , 2 ) + Math . pow ( cone_r , 2 ) ) ; System . out . println ( " Slant ▁ height ▁ of ▁ cone ▁ is : ▁ " + slant_height_cone ) ; } static void pyramidSlantHeight ( double pyramid_h , double pyramid_s ) { double slant_height_pyramid = Math . sqrt ( Math . pow ( pyramid_s / 2 , 2 ) + Math . pow ( pyramid_h , 2 ) ) ; System . out . println ( " Slant ▁ height ▁ of ▁ pyramid ▁ is : ▁ " + slant_height_pyramid ) ; } public static void main ( String [ ] args ) { double H1 = 4.5 , R = 6 ; coneSlantHeight ( H1 , R ) ; double H2 = 4 , S = 4.8 ; pyramidSlantHeight ( H2 , S ) ; } }

Class/struct names: GFG
Java program:
class GFG { static class pair { float first ; float second ; public pair ( float first , float second ) { this . first = first ; this . second = second ; } } static float distance ( float x1 , float y1 , float x2 , float y2 ) { return ( float ) Math . sqrt ( ( x2 - x1 ) * ( x2 - x1 ) + ( y2 - y1 ) * ( y2 - y1 ) ) ; } static void lengthOfLatusRectum ( float a , float b , float c ) { pair vertex = new pair ( ( - b / ( 2 * a ) ) , ( ( ( 4 * a * c ) - ( b * b ) ) / ( 4 * a ) ) ) ; pair focus = new pair ( ( - b / ( 2 * a ) ) , ( ( ( 4 * a * c ) - ( b * b ) + 1 ) / ( 4 * a ) ) ) ; System . out . print ( 4 * distance ( ( float ) focus . first , ( float ) focus . second , ( float ) vertex . first , ( float ) vertex . second ) ) ; } public static void main ( String [ ] args ) { float a = 3 , b = 5 , c = 1 ; lengthOfLatusRectum ( a , b , c ) ; } }

Class/struct names: GFG, pair
Java program:
import java . util . * ; class GFG { static double ConvertDegToRad ( double degree ) { double pi = 3.14159 ; return ( degree * ( pi / 180.0 ) ) ; } static void ConvertToCartesian ( double [ ] polar ) { polar [ 1 ] = ConvertDegToRad ( polar [ 1 ] ) ; double [ ] cartesian = { polar [ 0 ] * Math . cos ( polar [ 1 ] ) , polar [ 0 ] * Math . sin ( polar [ 1 ] ) } ; System . out . print ( String . format ( " % .3f " , cartesian [ 0 ] ) + " ▁ " + String . format ( " % .3f " , cartesian [ 1 ] ) ) ; } public static void main ( String [ ] args ) { double [ ] polar = { 1.4142 , 45 } ; ConvertToCartesian ( polar ) ; } }

Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static class pair { double first , second ; public pair ( double first , double second ) { this . first = first ; this . second = second ; } } static double distance ( pair p1 , pair p2 ) { double x1 = p1 . first , x2 = p2 . first ; double y1 = p1 . second , y2 = p2 . second ; return Math . sqrt ( Math . pow ( x2 - x1 , 2 ) + Math . pow ( y2 - y1 , 2 ) * 1.0 ) ; } static pair find_orthocenter ( pair A , pair B , pair C ) { double AB = distance ( A , B ) ; double BC = distance ( B , C ) ; double CA = distance ( C , A ) ; if ( AB > BC && AB > CA ) return C ; if ( BC > AB && BC > CA ) return A ; return B ; } static pair find_circumcenter ( pair A , pair B , pair C ) { double AB = distance ( A , B ) ; double BC = distance ( B , C ) ; double CA = distance ( C , A ) ; if ( AB > BC && AB > CA ) return new pair ( ( A . first + B . first ) / 2 , ( A . second + B . second ) / 2 ) ; if ( BC > AB && BC > CA ) return new pair ( ( B . first + C . first ) / 2 , ( B . second + C . second ) / 2 ) ; return new pair ( ( C . first + A . first ) / 2 , ( C . second + A . second ) / 2 ) ; } static void findDistance ( pair A , pair B , pair C ) { pair circumcenter = find_circumcenter ( A , B , C ) ; pair orthocenter = find_orthocenter ( A , B , C ) ; double distance_between = distance ( circumcenter , orthocenter ) ; System . out . print ( distance_between + "NEW_LINE"); } public static void main ( String [ ] args ) { pair A , B , C ; A = new pair ( 0.0 , 0.0 ) ; B = new pair ( 6.0 , 0.0 ) ; C = new pair ( 0.0 , 8.0 ) ; findDistance ( A , B , C ) ; } }

Class/struct names: GFG, pair
Java program:
import java . lang . * ; class GFG { public static int noOfTriangles ( int n ) { return ( n * ( n + 2 ) * ( 2 * n + 1 ) / 8 ) ; } public static void main ( String args [ ] ) { int n = 3 ; System . out . print ( noOfTriangles ( n ) ) ; } }

Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static int findNumberOfDigits ( int n , int base ) { int dig = ( ( int ) Math . floor ( Math . log ( n ) / Math . log ( base ) ) + 1 ) ; return dig ; } static boolean isAllKs ( int n , int b , int k ) { int len = findNumberOfDigits ( n , b ) ; int sum = k * ( 1 - ( int ) Math . pow ( b , len ) ) / ( 1 - b ) ; return sum == n ; } public static void main ( String [ ] args ) { int N = 13 ; int B = 3 ; int K = 1 ; if ( isAllKs ( N , B , K ) ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } }

Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static void checkRightAngled ( int X1 , int Y1 , int X2 , int Y2 , int X3 , int Y3 ) { int A = ( int ) Math . pow ( ( X2 - X1 ) , 2 ) + ( int ) Math . pow ( ( Y2 - Y1 ) , 2 ) ; int B = ( int ) Math . pow ( ( X3 - X2 ) , 2 ) + ( int ) Math . pow ( ( Y3 - Y2 ) , 2 ) ; int C = ( int ) Math . pow ( ( X3 - X1 ) , 2 ) + ( int ) Math . pow ( ( Y3 - Y1 ) , 2 ) ; if ( ( A > 0 && B > 0 && C > 0 ) && ( A == ( B + C ) || B == ( A + C ) || C == ( A + B ) ) ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } public static void main ( String s [ ] ) { int X1 = 0 , Y1 = 2 ; int X2 = 0 , Y2 = 14 ; int X3 = 9 , Y3 = 2 ; checkRightAngled ( X1 , Y1 , X2 , Y2 , X3 , Y3 ) ; } }

Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static void createPrefixArray ( int n , int arr [ ] , int prefSize , int pref [ ] ) { for ( int i = 0 ; i < prefSize ; i ++ ) { pref [ i ] = 0 ; } for ( int i = 0 ; i < n ; i ++ ) { int x = arr [ i ] + 1000000 ; pref [ x ] ++ ; } for ( int i = 1 ; i < prefSize ; i ++ ) { pref [ i ] += pref [ i - 1 ] ; } } static int pointsOfIntersection ( int m , int segments [ ] [ ] , int size , int pref [ ] ) { int ans = 0 ; for ( int i = 0 ; i < m ; i ++ ) { int x1 = segments [ i ] [ 0 ] ; int x2 = segments [ i ] [ 2 ] ; x1 = x1 + 1000000 ; x2 = x2 + 1000000 ; if ( x1 != x2 ) { if ( x1 > x2 ) { int temp = x1 ; x1 = x2 ; x2 = temp ; } int Occ_Till_Right = pref [ x2 - 1 ] ; int Occ_Till_Left = pref [ x1 ] ; ans = ans + ( Occ_Till_Right - Occ_Till_Left ) ; } } return ans ; } public static void main ( String [ ] args ) { int N = 4 ; int M = 8 ; int size = 2000000 + 2 ; int [ ] pref = new int [ size ] ; int lines [ ] = { - 5 , - 3 , 2 , 3 } ; int segments [ ] [ ] = { { - 2 , 5 , 5 , - 6 } , { - 5 , - 2 , - 3 , - 5 } , { - 2 , 3 , - 6 , 1 } , { - 1 , - 3 , 4 , 2 } , { 2 , 5 , 2 , 1 } , { 4 , 5 , 4 , - 5 } , { - 2 , - 4 , 5 , 3 } , { 1 , 2 , - 2 , 1 } } ; createPrefixArray ( N , lines , size , pref ) ; System . out . print ( pointsOfIntersection ( M , segments , size , pref ) + "NEW_LINE"); } }

Index/key variables: i, size, x, x1
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { static int count_rectangles ( int N , int M ) { int p_x = ( N * ( N - 1 ) ) / 2 ; int p_y = ( M * ( M - 1 ) ) / 2 ; return p_x * p_y ; } public static void main ( String [ ] args ) { int N = 3 ; int M = 6 ; System . out . print ( count_rectangles ( N , M ) ) ; } }

Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static void calculateAngle ( int x1 , int y1 , int z1 , int x2 , int y2 , int z2 , int x3 , int y3 , int z3 ) { int ABx = x1 - x2 ; int ABy = y1 - y2 ; int ABz = z1 - z2 ; int BCx = x3 - x2 ; int BCy = y3 - y2 ; int BCz = z3 - z2 ; double dotProduct = ABx * BCx + ABy * BCy + ABz * BCz ; double magnitudeAB = ABx * ABx + ABy * ABy + ABz * ABz ; double magnitudeBC = BCx * BCx + BCy * BCy + BCz * BCz ; double angle = dotProduct ; angle /= Math . sqrt ( magnitudeAB * magnitudeBC ) ; angle = ( angle * 180 ) / 3.14 ; System . out . printf ( " % .4f " , Math . abs ( angle ) ) ; } public static void main ( String [ ] args ) { int x1 = 1 , y1 = 3 , z1 = 3 ; int x2 = 3 , y2 = 4 , z2 = 5 ; int x3 = 5 , y3 = 6 , z3 = 9 ; calculateAngle ( x1 , y1 , z1 , x2 , y2 , z2 , x3 , y3 , z3 ) ; } }

Accumulator variables: angle
Class/struct names: GFG
Java program:
class GFG { static int calcAngle ( double h , double m ) { if ( h < 0 m < 0 h > 12 m > 60 ) System . out . printf ( " Wrong ▁ input " ) ; if ( h == 12 ) h = 0 ; if ( m == 60 ) m = 0 ; int hour_angle = ( int ) ( 0.5 * ( h * 60 + m ) ) ; int minute_angle = ( int ) ( 6 * m ) ; int angle = Math . abs ( hour_angle - minute_angle ) ; angle = Math . min ( 360 - angle , angle ) ; return angle ; } static float cal_cos ( float n ) { float accuracy = ( float ) 0.0001 , x1 , denominator , cosx , cosval ; n = ( float ) ( n * ( 3.142 / 180.0 ) ) ; x1 = 1 ; cosx = x1 ; cosval = ( float ) Math . cos ( n ) ; int i = 1 ; do { denominator = 2 * i * ( 2 * i - 1 ) ; x1 = - x1 * n * n / denominator ; cosx = cosx + x1 ; i = i + 1 ; } while ( accuracy <= Math . abs ( cosval - cosx ) ) ; return cosx ; } static float distanceEndpoints ( int a , int b , float c ) { float angle = cal_cos ( c ) ; return ( float ) Math . sqrt ( ( a * a ) + ( b * b ) - 2 * a * b * angle ) ; } public static void main ( String [ ] args ) { int hour = 3 ; int min = 30 ; int hourHand = 3 ; int minHand = 4 ; double angle = calcAngle ( hour , min ) ; float distance = distanceEndpoints ( minHand , hourHand , ( long ) angle ) ; System . out . printf ( " % .5f " , distance ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; import java . util . * ; class GFG { static int Octadecagonal_num ( int n ) { return ( 16 * n * n - 14 * n ) / 2 ; } public static void main ( String [ ] args ) { int n = 3 ; System . out . println ( Octadecagonal_num ( n ) ) ; n = 10 ; System . out . println ( Octadecagonal_num ( n ) ) ; } }

Class/struct names: GFG
Java program:
class GFG { static int IcositrigonalNum ( int n ) { return ( 21 * n * n - 19 * n ) / 2 ; } public static void main ( String [ ] args ) { int n = 3 ; System . out . print ( IcositrigonalNum ( n ) + "NEW_LINE"); n = 10 ; System . out . print ( IcositrigonalNum ( n ) ) ; } }

Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static int calculate_change ( int length , int breadth ) { int change = 0 ; change = length + breadth + ( ( length * breadth ) / 100 ) ; return change ; } public static void main ( String args [ ] ) { int cL = 20 ; int cB = - 10 ; int cA = calculate_change ( cL , cB ) ; System . out . println ( + cA ) ; } }

Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static int solve ( int n , int m , int obstacles , double range [ ] ) { double val = Math . min ( n , m ) ; Arrays . sort ( range ) ; int c = 1 ; for ( int i = obstacles - 1 ; i >= 0 ; i -- ) { range [ i ] = 2 * range [ i ] ; val -= range [ i ] ; if ( val <= 0 ) { return c ; } else { c ++ ; } } if ( val > 0 ) { return - 1 ; } return 0 ; } public static void main ( String [ ] args ) { int n = 4 , m = 5 , obstacles = 3 ; double range [ ] = { 1.0 , 1.25 , 1.15 } ; System . out . print ( solve ( n , m , obstacles , range ) + "NEW_LINE"); } }

Index/key variables: i
Accumulator variables: c, i, val
Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { static double area ( double d1 , double a ) { double d2 = Math . sqrt ( 4 * ( a * a ) - d1 * d1 ) ; double area = 0.5 * d1 * d2 ; return area ; } public static void main ( String [ ] args ) { double d = 7.07 ; double a = 5 ; System . out . println ( area ( d , a ) ) ; } }

Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static boolean pointsAreOnSameSideOfLine ( int a , int b , int c , int x1 , int y1 , int x2 , int y2 ) { fx1 = a * x1 + b * y1 - c ; fx2 = a * x2 + b * y2 - c ; if ( ( fx1 * fx2 ) > 0 ) return true ; return false ; } public static void main ( String [ ] args ) { int a = 1 , b = 1 , c = 1 ; int x1 = 1 , y1 = 1 ; int x2 = 2 , y2 = 1 ; if ( pointsAreOnSameSideOfLine ( a , b , c , x1 , y1 , x2 , y2 ) ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static void newvol ( double x ) { System . out . print ( " percentage ▁ increase ▁ " + " in ▁ the ▁ volume ▁ of ▁ the ▁ cube ▁ is ▁ " + ( Math . pow ( x , 3 ) / 10000 + 3 * x + ( 3 * Math . pow ( x , 2 ) ) / 100 ) ) ; System . out . print ( " % " ) ; } public static void main ( String [ ] args ) { double x = 10 ; newvol ( x ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static void findTriangles ( int n ) { int num = n ; System . out . print ( num + " ▁ " ) ; System . out . print ( num * ( num - 4 ) * ( num - 5 ) / 6 ) ; } public static void main ( String [ ] args ) { int n ; n = 6 ; findTriangles ( n ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static void radius ( int n , int d ) { System . out . print ( " The ▁ radius ▁ of ▁ each ▁ circle ▁ is ▁ " + d / ( 2 * n - 2 ) ) ; } static public void main ( String [ ] args ) { int d = 42 , n = 4 ; radius ( n , d ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static void radius ( int n , int d ) { System . out . print ( " The ▁ side ▁ of ▁ each ▁ square ▁ is ▁ " + d / ( n - 1 ) ) ; } public static void main ( String [ ] args ) { int d = 42 , n = 4 ; radius ( n , d ) ; } }

Class/struct names: GFG
Java program:
class GFG { static void findTriangles ( int n ) { int num ; num = n * ( n - 4 ) ; System . out . println ( num ) ; } public static void main ( String [ ] args ) { int n ; n = 6 ; findTriangles ( n ) ; } }

Class/struct names: GFG
Java program:
class GFG { static void diameter ( double r ) { System . out . println ( " The ▁ length ▁ of ▁ the ▁ longest ▁ chord " + " ▁ or ▁ diameter ▁ of ▁ the ▁ circle ▁ is ▁ " + 2 * r ) ; } public static void main ( String [ ] args ) { double r = 4 ; diameter ( r ) ; } }

Class/struct names: GFG
Java program:
class GfG { static double getSlope ( double m ) { return m ; } public static void main ( String [ ] args ) { double m = 2 ; System . out . println ( getSlope ( m ) ) ; } }

Class/struct names: GfG
Java program:
class GFG { public static int totalTriangles ( int h , int v ) { if ( h == 0 && v == 0 ) return 1 ; if ( h == 0 ) return ( ( v + 1 ) * ( v + 2 ) / 2 ) ; if ( v == 0 ) return ( h + 1 ) ; int total = ( h + 1 ) * ( ( v + 1 ) * ( v + 2 ) / 2 ) ; return total ; } public static void main ( String [ ] args ) { int h = 2 , v = 2 ; System . out . print ( totalTriangles ( h , v ) ) ; } }

Class/struct names: GFG
Java program:
import java . lang . Math ; class gfg { static float sph ( float r , float R , float h ) { if ( r < 0 && R < 0 && h < 0 ) return - 1 ; float x = r ; float V = ( float ) ( 4 * 3.14f * Math . pow ( r , 3 ) ) / 3 ; return V ; } public static void main ( String [ ] args ) { float r = 5 , R = 8 , h = 11 ; System . out . println ( sph ( r , R , h ) ) ; } }

Class/struct names: gfg
Java program:
class GFG { static double pentdiagonal ( double a ) { if ( a < 0 ) return - 1 ; double d = 1.22 * a ; return d ; } static public void main ( String args [ ] ) { double a = 6 ; System . out . println ( pentdiagonal ( a ) ) ; } }

Class/struct names: GFG
Java program:
import java . lang . Math ; public class GfG { public static float hexagonArea ( float d ) { return ( float ) ( ( 3 * Math . sqrt ( 3 ) * d * d ) / 8 ) ; } public static void main ( String [ ] args ) { float d = 10 ; System . out . println ( " Area ▁ of ▁ hexagon : ▁ " + hexagonArea ( d ) ) ; } }

Class/struct names: GfG
Java program:
import java . util . * ; class solution { static int Squares ( int n , int m , int a ) { return ( ( m + a - 1 ) / a ) * ( ( n + a - 1 ) / a ) ; } public static void main ( String arr [ ] ) { int n = 6 , m = 6 , a = 4 ; System . out . println ( Squares ( n , m , a ) ) ; } }

Class/struct names: solution
Java program:
import java . util . * ; class solution { static double octadiagonal ( double a ) { if ( a < 0 ) return - 1 ; return a * Math . sqrt ( 4 + ( 2 * Math . sqrt ( 2 ) ) ) ; } public static void main ( String args [ ] ) { double a = 4 ; System . out . println ( octadiagonal ( a ) ) ; } }

Class/struct names: solution
Java program:
import java . io . * ; class GFG { static double findEdges ( double s1 , double s2 , double s3 ) { double a = Math . sqrt ( s1 * s2 / s3 ) ; double b = Math . sqrt ( s3 * s1 / s2 ) ; double c = Math . sqrt ( s3 * s2 / s1 ) ; double sum = a + b + c ; return 4 * sum ; } public static void main ( String [ ] args ) { double s1 , s2 , s3 ; s1 = 65 ; s2 = 156 ; s3 = 60 ; System . out . print ( findEdges ( s1 , s2 , s3 ) ) ; } }

Class/struct names: GFG
Java program:
import java . util . * ; class GFG { public static int findMaximumPieces ( int n ) { int x = n / 2 ; return ( ( x + 1 ) * ( n - x + 1 ) ) ; } public static void main ( String [ ] args ) { int n = 3 ; System . out . print ( " Max ▁ number ▁ of ▁ pieces ▁ for ▁ n ▁ = ▁ " + n + " ▁ is ▁ " + findMaximumPieces ( 3 ) ) ; } }

Class/struct names: GFG
Java program:
public class GFG { static void equation_plane ( int x1 , int y1 , int z1 , int x2 , int y2 , int z2 , int x3 , int y3 , int z3 , int x , int y , int z ) { int a1 = x2 - x1 ; int b1 = y2 - y1 ; int c1 = z2 - z1 ; int a2 = x3 - x1 ; int b2 = y3 - y1 ; int c2 = z3 - z1 ; int a = b1 * c2 - b2 * c1 ; int b = a2 * c1 - a1 * c2 ; int c = a1 * b2 - b1 * a2 ; int d = ( - a * x1 - b * y1 - c * z1 ) ; if ( a * x + b * y + c * z + d == 0 ) System . out . println ( " Coplanar " ) ; else System . out . println ( " Not ▁ Coplanar " ) ; } public static void main ( String [ ] args ) { int x1 = 3 ; int y1 = 2 ; int z1 = - 5 ; int x2 = - 1 ; int y2 = 4 ; int z2 = - 3 ; int x3 = - 3 ; int y3 = 8 ; int z3 = - 5 ; int x4 = - 3 ; int y4 = 2 ; int z4 = 1 ; equation_plane ( x1 , y1 , z1 , x2 , y2 , z2 , x3 , y3 , z3 , x4 , y4 , z4 ) ; } }

Class/struct names: GFG