As you know that Educational Codeforces Round 54 (Rated for Div. 2) was held yesterday. Perhaps, you solved 1076B - Divisor Subtraction without any difficulty. Now, I am thinking how to solve this problem if there are no less than 10^5 queries. Please, mention the complexity with approach.