Hackerrank: Fraudulent Activity Notifications
Yes, deciding for each day in isolation is easy enough. And produces reusable and well-defined abstractions.
Unfortunately, it costs you. Specifically, it needs too long. Use a running-total, thus each day needs only subtracting one trailing day, adding the last day, and comparing to that day. The cost is pretty independent of the number of trailing days considered. It is easily adapted to streams.
Additionally, you really should avoid floating-point, not necessarily due to its runtime cost, but its design cost. Or do you have the time and inclination to prove conclusively whether your handling of floating point rounding is right?
I won't go into all the bad habits hackerrank encourages, like using &lt;bits/stdc++.h&gt;, using namespace std;, all the useless copies, ...
If you are interested, it's repeated enough times already.