A unifying approach to solve some classes of rank-three multiplicative and fractional programs involving linear functions