Count Non-Path Triplets in a Tree
Given a tree with n vertices numbered from 1 to n. The ith edge connects vertex ai to vertex bi, the task is to find the number of tuples of integers (i, j, k) such that: i < j < k and 1 <= i, j, k <= n. The given tree does not contain a simple path that includes all three vertices i, j,