Baised Standing Problem

I have submitted the code on spoj but getting TLE


long long int and array size equal to no of teams