5 solved (C++)
Naive soulution overall, and hard to check correctness. Running time is long because of the O(n^2) approach, and long/max value is not being used simply because I don't know the syntax and I don't have internet connection...
Minor comments and formatting fixes
Problem 6 solved (C++)