Feedback for REMOVEMUL problem

Problem Link: REMOVEMUL Problem - CodeChef
Idk the reason for which the code only gave right answers for datatype used as long long and not int. I’ve submitted after the contest the answer after the contest with long long datatype and now it’s showing as right answer while when I used it as int it was showing wrong earlier

Feedback

Consider a case where the size of set Q is just slightly less than N and N = (let’s say) 10^9. In that case sum ( (n+1)/2 * n ~= n^17) would be exceed the maximum capacity of int datatype. In this scenario, the result would be some strange value rather than the intended right answer. That’s why we are taking long long int.