Count of Unique Direct Path Between N Points On a Plane | C ++ program for the above approach ; Function to count the total number of direct paths ; Driver Code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int countDirectPath ( int N ) { return N + ( N * ( N - 3 ) ) / 2 ; } int main ( ) { int N = 5 ; cout << countDirectPath ( N ) ; return 0 ; }