in question GUESSNUM
what is role of sqrt(m) in the soln? why to optimise i am going till sqrt(m)??
and what is wrong with my approach … i tried several times but again it is showing tle securing only 50 pts ? please help me
my solution to the code : #include<bits/stdc++.h>
using namespace std;
#define lli long long int
the link is :codechef.com/viewsolution/28556059
what i am doing is : i am going to all the multiples of a(i in code) till m and my d (x in code) becomes m-i and if my d becomes greater than m/(a+1) then i break the loop? so for 1st test case : a=3 and m=35 it is running only 3 times ? so what is wrong with my approach please help me out to figure out this problem