C ++ program to find the shortest pairwise distance between any two different good nodes .
#include <bits/stdc++.h> NEW_LINE using namespace std ; #define N  100005 NEW_LINE const int MAXI = 99999999 ;