C ++ program to print maximum path sum ending with each position x such that all path step positions divide x .
#include <bits/stdc++.h> NEW_LINE using namespace std ; void printMaxSum ( int arr [ ] , int n ) {