dhyuti-n/xlcost-variable-roles huggingface dataset:
Java program:
import java . util . ArrayList ; import java . util . Arrays ; class GFG { static ArrayList < Integer > merge ( ArrayList < Integer > x , ArrayList < Integer > y ) { for ( Integer i : y ) { if ( x . get ( x . size ( ) - 1 ) > i ) x . add ( i ) ; } return x ; } static ArrayList < Integer > mergeDel ( ArrayList < Integer > l ) { if ( l . size ( ) == 1 ) return l ; int m = l . size ( ) / 2 ; ArrayList < Integer > temp1 = new ArrayList < > ( l . subList ( 0 , m ) ) ; ArrayList < Integer > temp2 = new ArrayList < > ( l . subList ( m , l . size ( ) ) ) ; return merge ( mergeDel ( temp1 ) , mergeDel ( temp2 ) ) ; } public static void main ( String [ ] args ) { Integer [ ] ar = { 5 , 4 , 3 , 2 , 1 } ; ArrayList < Integer > arr = new ArrayList < > ( Arrays . asList ( ar ) ) ; ArrayList < Integer > ans = mergeDel ( arr ) ; System . out . print ( " [ ▁ " ) ; for ( Integer x : ans ) System . out . print ( x + " , ▁ " ) ; System . out . println ( " ] " ) ; } }

Iterator variables: i, x
Class/struct names: GFG
Java program:
class GFG { static int mergeSort ( int arr [ ] , int array_size ) { int temp [ ] = new int [ array_size ] ; return _mergeSort ( arr , temp , 0 , array_size - 1 ) ; } static int _mergeSort ( int arr [ ] , int temp [ ] , int left , int right ) { int mid , inv_count = 0 ; if ( right > left ) { mid = ( right + left ) / 2 ; inv_count = _mergeSort ( arr , temp , left , mid ) ; inv_count += _mergeSort ( arr , temp , mid + 1 , right ) ; inv_count += merge ( arr , temp , left , mid + 1 , right ) ; } return inv_count ; } static int merge ( int arr [ ] , int temp [ ] , int left , int mid , int right ) { int i , j , k ; int inv_count = 0 ; i = left ; j = mid ; k = left ; while ( ( i <= mid - 1 ) && ( j <= right ) ) { if ( arr [ i ] > 2 * arr [ j ] ) { inv_count += ( mid - i ) ; j ++ ; } else { i ++ ; } } i = left ; j = mid ; k = left ; while ( ( i <= mid - 1 ) && ( j <= right ) ) { if ( arr [ i ] <= arr [ j ] ) { temp [ k ++ ] = arr [ i ++ ] ; } else { temp [ k ++ ] = arr [ j ++ ] ; } } while ( i <= mid - 1 ) temp [ k ++ ] = arr [ i ++ ] ; while ( j <= right ) temp [ k ++ ] = arr [ j ++ ] ; for ( i = left ; i <= right ; i ++ ) arr [ i ] = temp [ i ] ; return inv_count ; } public static void main ( String [ ] args ) { int arr [ ] = { 1 , 20 , 6 , 4 , 5 } ; int n = arr . length ; System . out . println ( mergeSort ( arr , n ) ) ; } }

Index/key variables: array_size, i, j
Accumulator variables: i, inv_count, j, k
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; class geeks { static int N = 100005 ; static int [ ] lazy = new int [ 4 * N ] ; static Set < Integer > se = new HashSet < Integer > ( ) ; public static void update ( int x , int y , int value , int id , int l , int r ) { if ( x >= r l >= y ) return ; if ( x <= l && r <= y ) { lazy [ id ] = value ; return ; } int mid = ( l + r ) / 2 ; if ( lazy [ id ] != 0 ) lazy [ 2 * id ] = lazy [ 2 * id + 1 ] = lazy [ id ] ; lazy [ id ] = 0 ; update ( x , y , value , 2 * id , l , mid ) ; update ( x , y , value , 2 * id + 1 , mid , r ) ; } public static void query ( int id , int l , int r ) { if ( lazy [ id ] != 0 ) { se . add ( lazy [ id ] ) ; return ; } if ( r - l < 2 ) return ; int mid = ( l + r ) / 2 ; query ( 2 * id , l , mid ) ; query ( 2 * id + 1 , mid , r ) ; } public static void main ( String [ ] args ) { int n = 5 , q = 3 ; update ( 1 , 4 , 1 , 1 , 0 , n ) ; update ( 0 , 2 , 2 , 1 , 0 , n ) ; update ( 3 , 4 , 3 , 1 , 0 , n ) ; query ( 1 , 0 , n ) ; System . out . println ( se . size ( ) ) ; } }

Index/key variables: id
Class/struct names: geeks
Java program:
class GfG { static int MAX = 100 ; static int MOD = 1000000009 ; static int power ( int n ) { if ( n <= 1 ) { return 1 ; } n -- ; int res [ ] [ ] = { { 1 , 0 } , { 0 , 1 } } ; int tMat [ ] [ ] = { { 2 , 3 } , { 1 , 0 } } ; while ( n > 0 ) { if ( n % 2 == 1 ) { int tmp [ ] [ ] = new int [ 2 ] [ 2 ] ; tmp [ 0 ] [ 0 ] = ( res [ 0 ] [ 0 ] * tMat [ 0 ] [ 0 ] + res [ 0 ] [ 1 ] * tMat [ 1 ] [ 0 ] ) % MOD ; tmp [ 0 ] [ 1 ] = ( res [ 0 ] [ 0 ] * tMat [ 0 ] [ 1 ] + res [ 0 ] [ 1 ] * tMat [ 1 ] [ 1 ] ) % MOD ; tmp [ 1 ] [ 0 ] = ( res [ 1 ] [ 0 ] * tMat [ 0 ] [ 0 ] + res [ 1 ] [ 1 ] * tMat [ 1 ] [ 0 ] ) % MOD ; tmp [ 1 ] [ 1 ] = ( res [ 1 ] [ 0 ] * tMat [ 0 ] [ 1 ] + res [ 1 ] [ 1 ] * tMat [ 1 ] [ 1 ] ) % MOD ; res [ 0 ] [ 0 ] = tmp [ 0 ] [ 0 ] ; res [ 0 ] [ 1 ] = tmp [ 0 ] [ 1 ] ; res [ 1 ] [ 0 ] = tmp [ 1 ] [ 0 ] ; res [ 1 ] [ 1 ] = tmp [ 1 ] [ 1 ] ; } n = n / 2 ; int tmp [ ] [ ] = new int [ 2 ] [ 2 ] ; tmp [ 0 ] [ 0 ] = ( tMat [ 0 ] [ 0 ] * tMat [ 0 ] [ 0 ] + tMat [ 0 ] [ 1 ] * tMat [ 1 ] [ 0 ] ) % MOD ; tmp [ 0 ] [ 1 ] = ( tMat [ 0 ] [ 0 ] * tMat [ 0 ] [ 1 ] + tMat [ 0 ] [ 1 ] * tMat [ 1 ] [ 1 ] ) % MOD ; tmp [ 1 ] [ 0 ] = ( tMat [ 1 ] [ 0 ] * tMat [ 0 ] [ 0 ] + tMat [ 1 ] [ 1 ] * tMat [ 1 ] [ 0 ] ) % MOD ; tmp [ 1 ] [ 1 ] = ( tMat [ 1 ] [ 0 ] * tMat [ 0 ] [ 1 ] + tMat [ 1 ] [ 1 ] * tMat [ 1 ] [ 1 ] ) % MOD ; tMat [ 0 ] [ 0 ] = tmp [ 0 ] [ 0 ] ; tMat [ 0 ] [ 1 ] = tmp [ 0 ] [ 1 ] ; tMat [ 1 ] [ 0 ] = tmp [ 1 ] [ 0 ] ; tMat [ 1 ] [ 1 ] = tmp [ 1 ] [ 1 ] ; } return ( res [ 0 ] [ 0 ] * 1 + res [ 0 ] [ 1 ] * 1 ) % MOD ; } public static void main ( String [ ] args ) { int n = 3 ; System . out . println ( power ( n ) ) ; } }

Accumulator variables: n
Class/struct names: GfG
Java program:
import java . util . Arrays ; public class GFG { static void shuffleArray ( int a [ ] , int n ) { for ( int i = 0 , q = 1 , k = n ; i < n ; i ++ , k ++ , q ++ ) for ( int j = k ; j > i + q ; j -- ) { int temp = a [ j - 1 ] ; a [ j - 1 ] = a [ j ] ; a [ j ] = temp ; } } public static void main ( String [ ] args ) { int a [ ] = { 1 , 3 , 5 , 7 , 2 , 4 , 6 , 8 } ; shuffleArray ( a , a . length / 2 ) ; System . out . println ( Arrays . toString ( a ) ) ; } }

Index/key variables: j
Accumulator variables: i, j, k, q
Iterator variables: i, j
Class/struct names: GFG
Java program:
import java . util . Arrays ; class GFG { static boolean isFeasible ( int mid , int arr [ ] , int n , int k ) { int pos = arr [ 0 ] ; int elements = 1 ; for ( int i = 1 ; i < n ; i ++ ) { if ( arr [ i ] - pos >= mid ) { pos = arr [ i ] ; elements ++ ; if ( elements == k ) return true ; } } return false ; } static int largestMinDist ( int arr [ ] , int n , int k ) { Arrays . sort ( arr ) ; int res = - 1 ; int left = 1 , right = arr [ n - 1 ] ; while ( left < right ) { int mid = ( left + right ) / 2 ; if ( isFeasible ( mid , arr , n , k ) ) { res = Math . max ( res , mid ) ; left = mid + 1 ; } else right = mid ; } return res ; } public static void main ( String [ ] args ) { int arr [ ] = { 1 , 2 , 8 , 4 , 9 } ; int n = arr . length ; int k = 3 ; System . out . print ( largestMinDist ( arr , n , k ) ) ; } }

Index/key variables: i
Accumulator variables: elements, i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . io . * ; import java . util . * ; class GFG { static void findFrequency ( int [ ] arr , int n ) { Map < Integer , Integer > mp = new HashMap < Integer , Integer > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( ! mp . containsKey ( arr [ i ] ) ) mp . put ( arr [ i ] , 0 ) ; mp . put ( arr [ i ] , mp . get ( arr [ i ] ) + 1 ) ; } for ( Map . Entry < Integer , Integer > kvp : mp . entrySet ( ) ) { System . out . println ( " Element ▁ " + kvp . getKey ( ) + " ▁ occurs ▁ " + kvp . getValue ( ) + " ▁ times " ) ; } } public static void main ( String [ ] args ) { int [ ] arr = { 1 , 1 , 1 , 2 , 3 , 3 , 5 , 5 , 8 , 8 , 8 , 9 , 9 , 10 } ; int n = arr . length ; findFrequency ( arr , n ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
public class Test { public static int floorSqrt ( int x ) { if ( x == 0 x == 1 ) return x ; long start = 1 , end = x , ans = 0 ; while ( start <= end ) { int mid = ( start + end ) / 2 ; if ( mid * mid == x ) return ( int ) mid ; if ( mid * mid < x ) { start = mid + 1 ; ans = mid ; } end = mid - 1 ; } return ( int ) ans ; } public static void main ( String args [ ] ) { int x = 11 ; System . out . println ( floorSqrt ( x ) ) ; } }

Class/struct names: Test
Java program:
class GFG { static void findSides ( double A , double C , double c ) { double B = 180 - ( A + C ) ; A = A * ( 3.14159 / 180 ) ; C = C * ( 3.14159 / 180 ) ; B = B * ( 3.14159 / 180 ) ; double a = ( c / Math . sin ( C ) ) * Math . sin ( A ) ; double b = ( c / Math . sin ( C ) ) * Math . sin ( B ) ; System . out . println ( String . format ( " % .2f " , a ) ) ; System . out . println ( String . format ( " % .2f " , b ) ) ; } public static void main ( String [ ] args ) { double A = 45.0 ; double C = 35.0 ; double c = 23 ; findSides ( A , C , c ) ; } }

Class/struct names: GFG
Java program:
class Node { char data ; Node left , right ; Node ( char item ) { data = item ; left = right = null ; } } class Index { int index ; } class BinaryTree { Node root ; Index index_obj = new Index ( ) ; void storeAlternate ( Node node , char arr [ ] , Index index , int l ) { if ( node == null ) { return ; } storeAlternate ( node . left , arr , index , l + 1 ) ; if ( l % 2 != 0 ) { arr [ index . index ] = node . data ; index . index ++ ; } storeAlternate ( node . right , arr , index , l + 1 ) ; } void modifyTree ( Node node , char arr [ ] , Index index , int l ) { if ( node == null ) { return ; } modifyTree ( node . left , arr , index , l + 1 ) ; if ( l % 2 != 0 ) { node . data = arr [ index . index ] ; ( index . index ) ++ ; } modifyTree ( node . right , arr , index , l + 1 ) ; } void reverse ( char arr [ ] , int n ) { int l = 0 , r = n - 1 ; while ( l < r ) { char temp = arr [ l ] ; arr [ l ] = arr [ r ] ; arr [ r ] = temp ; l ++ ; r -- ; } } void reverseAlternate ( ) { reverseAlternate ( root ) ; } void reverseAlternate ( Node node ) { char [ ] arr = new char [ 100 ] ; storeAlternate ( node , arr , index_obj , 0 ) ; reverse ( arr , index_obj . index ) ; index_obj . index = 0 ; modifyTree ( node , arr , index_obj , 0 ) ; } void printInorder ( ) { printInorder ( root ) ; } void printInorder ( Node node ) { if ( node == null ) { return ; } printInorder ( node . left ) ; System . out . print ( node . data + " ▁ " ) ; printInorder ( node . right ) ; } public static void main ( String args [ ] ) { BinaryTree tree = new BinaryTree ( ) ; tree . root = new Node ( ' a ' ) ; tree . root . left = new Node ( ' b ' ) ; tree . root . right = new Node ( ' c ' ) ; tree . root . left . left = new Node ( ' d ' ) ; tree . root . left . right = new Node ( ' e ' ) ; tree . root . right . left = new Node ( ' f ' ) ; tree . root . right . right = new Node ( ' g ' ) ; tree . root . left . left . left = new Node ( ' h ' ) ; tree . root . left . left . right = new Node ( ' i ' ) ; tree . root . left . right . left = new Node ( ' j ' ) ; tree . root . left . right . right = new Node ( ' k ' ) ; tree . root . right . left . left = new Node ( ' l ' ) ; tree . root . right . left . right = new Node ( ' m ' ) ; tree . root . right . right . left = new Node ( ' n ' ) ; tree . root . right . right . right = new Node ( ' o ' ) ; System . out . println ( " Inorder ▁ Traversal ▁ of ▁ given ▁ tree " ) ; tree . printInorder ( ) ; tree . reverseAlternate ( ) ; System . out . println ( " " ) ; System . out . println ( " " ) ; System . out . println ( " Inorder ▁ Traversal ▁ of ▁ modified ▁ tree " ) ; tree . printInorder ( ) ; } }

Index/key variables: l, r
Accumulator variables: index, l, r
Class/struct names: BinaryTree, Index, Node
Java program:
import java . io . * ; class GFG { static double line_slope ( double a , double b ) { if ( a != 0 ) return - b / a ; else return ( - 2 ) ; } static void line_equation ( double a , double b , double c , double x1 , double y1 , double alfa ) { double given_slope = line_slope ( a , b ) ; double x = alfa * 3.14159 / 180 ; if ( given_slope == - 2 ) { double slope_1 = Math . tan ( x ) ; double slope_2 = Math . tan ( 3.14159 - x ) ; int g = ( int ) x1 , f = ( int ) x1 ; g *= ( - slope_1 ) ; g += y1 ; if ( g > 0 ) System . out . println ( " y ▁ = ▁ " + ( Math . round ( slope_1 * 100.0 ) / 100.0 ) + " x ▁ + " + ( Math . round ( g * 100.0 ) / 100.0 ) ) ; if ( g <= 0 ) System . out . println ( " y ▁ = ▁ " + ( Math . round ( slope_1 * 100.0 ) / 100.0 ) + " x ▁ " + ( Math . round ( g * 100.0 ) / 100.0 ) ) ; f *= ( - slope_2 ) ; f += y1 ; if ( f > 0 ) { System . out . println ( " y ▁ = ▁ " + ( Math . round ( slope_2 * 100.0 ) / 100.0 ) + " x ▁ + " + ( Math . round ( f * 100.0 ) / 100.0 ) ) ; } if ( f <= 0 ) System . out . println ( " y ▁ = ▁ " + ( Math . round ( slope_1 * 100.0 ) / 100.0 ) + " x ▁ " + ( Math . round ( g * 100.0 ) / 100.0 ) ) ; return ; } if ( 1 - Math . tan ( x ) * given_slope == 0 ) { System . out . println ( " x ▁ = ▁ " + ( Math . round ( x1 * 100.0 ) / 100.0 ) ) ; } if ( 1 + Math . tan ( x ) * given_slope == 0 ) { System . out . println ( " x ▁ = ▁ " + ( Math . round ( x1 * 100.0 ) / 100.0 ) ) ; } double slope_1 = ( given_slope + Math . tan ( x ) ) / ( 1 - Math . tan ( x ) * given_slope ) ; double slope_2 = ( given_slope - Math . tan ( x ) ) / ( 1 + Math . tan ( x ) * given_slope ) ; int g = ( int ) x1 , f = ( int ) x1 ; g *= ( - slope_1 ) ; g += y1 ; if ( g > 0 && 1 - Math . tan ( x ) * given_slope != 0 ) System . out . println ( " y ▁ = ▁ " + ( Math . round ( slope_1 * 100.0 ) / 100.0 ) + " x ▁ + " + ( Math . round ( g * 100.0 ) / 100.0 ) ) ; if ( g <= 0 && 1 - Math . tan ( x ) * given_slope != 0 ) System . out . println ( " y ▁ = ▁ " + ( Math . round ( slope_1 * 100.0 ) / 100.0 ) + " x ▁ " + ( Math . round ( g * 100.0 ) / 100.0 ) ) ; f *= ( - slope_2 ) ; f += y1 ; if ( f > 0 && 1 + Math . tan ( x ) * given_slope != 0 ) { System . out . println ( " y ▁ = ▁ " + ( Math . round ( slope_2 * 100.0 ) / 100.0 ) + " x ▁ + " + ( Math . round ( f * 100.0 ) / 100.0 ) ) ; } if ( f <= 0 && 1 + Math . tan ( x ) * given_slope != 0 ) System . out . println ( " y ▁ = ▁ " + ( Math . round ( slope_2 * 100.0 ) / 100.0 ) + " x ▁ + " + ( Math . round ( f * 100.0 ) / 100.0 ) ) ; } public static void main ( String [ ] args ) { double a = 2 , b = 3 , c = - 7 ; double x1 = 4 , y1 = 9 ; double alfa = 30 ; line_equation ( a , b , c , x1 , y1 , alfa ) ; } }

Accumulator variables: f, g
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static double normal_slope ( double a , double b , double x1 , double y1 ) { double g = a / 2 ; double f = b / 2 ; if ( g - x1 == 0 ) return ( - 1 ) ; double slope = ( f - y1 ) / ( g - x1 ) ; if ( slope == 0 ) return ( - 2 ) ; return slope ; } static void normal_equation ( double a , double b , double x1 , double y1 ) { double slope = normal_slope ( a , b , x1 , y1 ) ; if ( slope == - 1 ) { System . out . print ( " x ▁ = ▁ " + x1 ) ; } if ( slope == - 2 ) { System . out . print ( " y ▁ = ▁ " + y1 ) ; } if ( slope != - 1 && slope != - 2 ) { x1 *= - slope ; x1 += y1 ; if ( x1 > 0 ) System . out . print ( " y ▁ = ▁ " + slope + " x ▁ + ▁ " + x1 ) ; else System . out . print ( " y ▁ = ▁ " + slope + " x ▁ " + x1 ) ; } } public static void main ( String [ ] args ) { int a = 4 , b = 6 ; int x1 = 12 , y1 = 14 ; normal_equation ( a , b , x1 , y1 ) ; } }

Accumulator variables: x1
Class/struct names: GFG
Java program:
import java . io . * ; import java . util . * ; class GFG { static void findSquareSum ( int Coordinates [ ] [ ] , int N ) { long xq = 0 , yq = 0 ; long xs = 0 , ys = 0 ; long res = 0 ; for ( int i = 0 ; i < N ; i ++ ) { int a , b ; a = Coordinates [ i ] [ 0 ] ; b = Coordinates [ i ] [ 1 ] ; res += xq ; res -= 2 * xs * a ; res += i * ( long ) ( a * a ) ; xq += a * a ; xs += a ; res += yq ; res -= 2 * ys * b ; res += i * ( long ) b * b ; yq += b * b ; ys += b ; } System . out . println ( res ) ; } public static void main ( String [ ] args ) { int arr [ ] [ ] = { { 1 , 1 } , { - 1 , - 1 } , { 1 , - 1 } , { - 1 , 1 } } ; int N = arr . length ; findSquareSum ( arr , N ) ; } }

Index/key variables: i
Accumulator variables: i, res, xq, xs, yq, ys
Iterator variables: i
Class/struct names: GFG
Java program:
import java . io . * ; class Gfg { public static int getPointsIns ( int x1 , int y1 , int radius , int x2 , int y2 , pair points [ ] ) { int ans = 0 ; for ( int i = 0 ; i < points . length ; i ++ ) { boolean condOne = false , condTwo = false ; if ( ( points [ i ] . b - y2 ) * ( x2 - x1 ) - ( y2 - y1 ) * ( points [ i ] . a - x2 ) >= 0 ) { condOne = true ; } if ( radius >= ( int ) Math . sqrt ( Math . pow ( ( y1 - points [ i ] . b ) , 2 ) + Math . pow ( x1 - points [ i ] . a , 2 ) ) ) { condTwo = true ; } if ( condOne && condTwo ) { ans += 1 ; } } return ans ; } public static void main ( String [ ] args ) { int X = 0 ; int Y = 0 ; int R = 5 ; int P = 5 ; int Q = 0 ; pair arr [ ] = { new pair ( 2 , 3 ) , new pair ( 5 , 6 ) , new pair ( - 1 , 4 ) , new pair ( 5 , 5 ) } ; System . out . print ( getPointsIns ( X , Y , R , P , Q , arr ) ) ; } } class pair { int a ; int b ; pair ( int a , int b ) { this . a = a ; this . b = b ; } }

Index/key variables: i
Accumulator variables: ans, i
Iterator variables: i
Boolean variables: condOne, condTwo
Class/struct names: Gfg, pair
Java program:
class GFG { static void cntPairs ( int [ ] [ ] points , int n , int K ) { int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = i + 1 ; j < n ; j ++ ) { int dist = 0 ; for ( int k = 0 ; k < K ; k ++ ) { int temp = ( points [ i ] [ k ] - points [ j ] [ k ] ) ; dist += temp * temp ; } if ( Math . sqrt ( dist ) * Math . sqrt ( dist ) == dist ) { ans += 1 ; } } } System . out . print ( ans + "NEW_LINE"); } public static void main ( String [ ] args ) { int K = 2 ; int [ ] [ ] points = { { 1 , 2 } , { 5 , 5 } , { - 2 , 8 } } ; int n = points . length ; cntPairs ( points , n , K ) ; } }

Index/key variables: i, j, k
Accumulator variables: ans, dist, i, j, k
Iterator variables: i, j, k
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static double Circumradius ( int a , int b , int c , int d ) { double s = ( a + b + c + d ) / 2.0 ; double radius = Math . sqrt ( ( ( a * b ) + ( c * d ) ) * ( ( a * c ) + ( b * d ) ) * ( ( a * d ) + ( b * c ) ) / ( ( s - a ) * ( s - b ) * ( s - c ) * ( s - d ) ) ) ; return radius / 4 ; } public static void main ( String [ ] args ) { int A = 3 ; int B = 4 ; int C = 5 ; int D = 6 ; double ans = Circumradius ( A , B , C , D ) ; System . out . format ( " % .2f " , ans ) ; } }

Class/struct names: GFG
Java program:
class GFG { static float Area_of_Triangle ( int a , int b , int k ) { float area = ( float ) ( ( 1 / 2.0 ) * a * b * Math . sin ( k ) ) ; return area ; } public static void main ( String [ ] args ) { int a = 9 ; int b = 12 ; int k = 2 ; float ans = Area_of_Triangle ( a , b , k ) ; System . out . printf ( " % .1f " , ans ) ; } }

Class/struct names: GFG
Java program:
class GFG { static class point { double x , y ; public point ( ) { } public point ( double x , double y ) { this . x = x ; this . y = y ; } } ; static void lineFromPoints ( point P , point Q , double a , double b , double c ) { a = Q . y - P . y ; b = P . x - Q . x ; c = a * ( P . x ) + b * ( P . y ) ; } static void perpenBisectorFromLine ( point P , point Q , double a , double b , double c ) { point mid_point = new point ( ) ; mid_point . x = ( P . x + Q . x ) / 2 ; mid_point . y = ( P . y + Q . y ) / 2 ; c = - b * ( mid_point . x ) + a * ( mid_point . y ) ; double temp = a ; a = - b ; b = temp ; } static double LineInterX ( double a1 , double b1 , double c1 , double a2 , double b2 , double c2 ) { double determ = a1 * b2 - a2 * b1 ; double x = ( b2 * c1 - b1 * c2 ) ; x /= determ ; return x ; } static double LineInterY ( double a1 , double b1 , double c1 , double a2 , double b2 , double c2 ) { double determ = a1 * b2 - a2 * b1 ; double y = ( a1 * c2 - a2 * c1 ) ; y /= determ ; return y ; } static void findPosition ( point P , point Q , point R , point D ) { point r = new point ( ) ; double a = 0 , b = 0 , c = 0 ; lineFromPoints ( P , Q , a , b , c ) ; double e = 0 , f = 0 , g = 0 ; lineFromPoints ( Q , R , e , f , g ) ; perpenBisectorFromLine ( P , Q , a , b , c ) ; perpenBisectorFromLine ( Q , R , e , f , g ) ; r . x = LineInterX ( a , b , c , e , f , g ) ; r . y = LineInterY ( a , b , c , e , f , g ) ; double q = ( r . x - P . x ) * ( r . x - P . x ) + ( r . y - P . y ) * ( r . y - P . y ) ; double dis = ( r . x - D . x ) * ( r . x - D . x ) + ( r . y - D . y ) * ( r . y - D . y ) ; if ( dis < q ) { System . out . print ( " Point ▁ ( " + D . x + " , ▁ " + D . y + " ) ▁ is ▁ inside ▁ " + " the ▁ circumcircle " ) ; } else if ( dis == q ) { System . out . print ( " Point ▁ ( " + D . x + " , ▁ " + D . y + " ) ▁ lies ▁ on ▁ the ▁ " + " circumcircle " ) ; } else { System . out . print ( " Point ▁ ( " + D . x + " , ▁ " + D . y + " ) ▁ lies ▁ outside " + " ▁ the ▁ circumcircle " ) ; } } public static void main ( String [ ] args ) { point A , B , C , D ; A = new point ( 2 , 8 ) ; B = new point ( 2 , 1 ) ; C = new point ( 4 , 5 ) ; D = new point ( 3 , 0 ) ; findPosition ( A , B , C , D ) ; } }

Accumulator variables: x, y
Class/struct names: GFG, point
Java program:
class GFG { static float find_angle ( int x , int y , int z ) { int volume = x * x * y ; float ans = 0 ; if ( z < volume / 2 ) { float d = ( float ) ( ( x * y * y ) / ( 2.0 * z ) ) ; ans = ( float ) Math . atan ( d ) ; } else { z = volume - z ; float d = ( 2 * z ) / ( float ) ( x * x * x ) ; ans = ( float ) Math . atan ( d ) ; } ans = ( float ) ( ( ans * 180 ) / 3.14159265 ) ; return ans ; } public static void main ( String [ ] args ) { int x = 12 ; int y = 21 ; int z = 10 ; System . out . print ( find_angle ( x , y , z ) + "NEW_LINE"); } }

Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static int countOdd ( int n ) { int coun = 0 , m , j , i ; for ( i = n - 2 ; i >= 1 ; i -- ) { if ( i >= 1 ) { m = ( n - i ) / 2 ; j = ( i * ( i + 1 ) ) / 2 ; coun += j * m ; } else { m = ( ( n - 1 ) - i ) / 2 ; j = ( i * ( i + 1 ) ) / 2 ; coun += j * m ; } } return coun ; } static int countEven ( int n ) { int coun = 0 , m , j , i ; for ( i = n - 2 ; i >= 1 ; i -- ) { if ( i >= 1 ) { m = ( ( n - 1 ) - i ) / 2 ; j = ( i * ( i + 1 ) ) / 2 ; coun += j * m ; } else { m = ( n - i ) / 2 ; j = ( i * ( i + 1 ) ) / 2 ; coun += j * m ; } } return coun ; } public static void main ( String [ ] args ) { int n = 5 ; if ( n >= 1 ) System . out . println ( countOdd ( n ) ) ; else System . out . println ( countEven ( n ) ) ; } }

Accumulator variables: coun, i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; import java . lang . * ; import java . io . * ; class GFG { static float ellipse ( float l , float b ) { if ( l < 0 b < 0 ) return - 1 ; float x = ( float ) ( 3.14 * l * b ) / 4 ; return x ; } public static void main ( String args [ ] ) { float a = 5 , b = 3 ; System . out . println ( ellipse ( a , b ) ) ; } }

Class/struct names: GFG
Java program:
class GFG { static int __gcd ( int a , int b ) { if ( b == 0 ) return a ; return __gcd ( b , a % b ) ; } static void noOfSquares ( int x1 , int y1 , int x2 , int y2 ) { int dx = Math . abs ( x2 - x1 ) ; int dy = Math . abs ( y2 - y1 ) ; int ans = dx + dy - __gcd ( dx , dy ) ; System . out . println ( ans ) ; } public static void main ( String [ ] args ) { int x1 = 1 , y1 = 1 , x2 = 4 , y2 = 3 ; noOfSquares ( x1 , y1 , x2 , y2 ) ; } }

Class/struct names: GFG
Java program:
class GfG { static long binomialCoeff ( int n , int k ) { long res = 1 ; if ( k > n - k ) k = n - k ; for ( int i = 0 ; i < k ; ++ i ) { res *= ( n - i ) ; res /= ( i + 1 ) ; } return res ; } static long countPaths ( int x1 , int y1 , int x2 , int y2 ) { int m = Math . abs ( x1 - x2 ) ; int n = Math . abs ( y1 - y2 ) ; return ( binomialCoeff ( m + n , n ) ) ; } public static void main ( String [ ] args ) { int x1 = 2 , y1 = 3 , x2 = 4 , y2 = 5 ; System . out . println ( countPaths ( x1 , y1 , x2 , y2 ) ) ; } }

Accumulator variables: res
Iterator variables: i
Class/struct names: GfG
Java program:
class GFG { static double areaCircle ( double b ) { double area = ( double ) 3.1415926 * b * b ; return area ; } public static void main ( String args [ ] ) { float a = 10 , b = 8 ; System . out . println ( areaCircle ( b ) ) ; } }

Class/struct names: GFG