A Decomposition Method for Both Additively and Non-additively Separable Problems