Maximum points of intersections possible among X circles and Y straight lines | Java program to implement the above approach ; Driver code ; Number of circles ; Number of straight lines ; Function Call
class GFG { static int maxPointOfIntersection ( int x , int y ) { int k = y * ( y - 1 ) / 2 ; k = k + x * ( 2 * y + x - 1 ) ; return k ; } public static void main ( String [ ] args ) { int x = 3 ; int y = 4 ; System . out . print ( maxPointOfIntersection ( x , y ) ) ; } }