text: Count Distinct Rectangles in N * N Chessboard | C ++ code to count distinct rectangle in a chessboard ; Function to return the count of distinct rectangles ; Driver Code
code: #include <bits/stdc++.h> NEW_LINE using namespace std ; int count ( int N ) { int a = 0 ; a = ( N * ( N + 1 ) ) / 2 ; return a ; } int main ( ) { int N = 4 ; cout << count ( N ) ; }