On the distribution of the weighted sum of chi-squared variables