Count of Unique Direct Path Between N Points On a Plane | Java program for the above approach ; Function to count the total number of direct paths ; Driver Code
import java . io . * ; class GFG { static int countDirectPath ( int N ) { return N + ( N * ( N - 3 ) ) / 2 ; } public static void main ( String [ ] args ) { int N = 5 ; System . out . print ( countDirectPath ( N ) ) ; } }