problem: (F) Best Edge Weight Solution in C/C++ Archive