CSUB - Editorial

Take c as long long int.

Count of 1 can be as high as 10^5 , and when you multiply it n*(n+1), its goes out of range , thus we need to take long long int for n.