How codechef calculates contest rating?

I know contest ratings depends on the number of questions solved successfully and time(may be) , but what are the other factors that affect the user ratings? What mathematical formula Codechef use to calculate the ratings.

The formula is described hereā€¦ ratings. It depends on your rank in present contest(So in short contests depends on time also), your previous rating.