Cbscholarshippro

Scanner scn=new Scanner (System.in);
int x=scn.nextInt();
int y=scn.nextInt();
int t=scn.nextInt();
int w=scn.nextInt();
int m=y/t;

if(m<x)
	{
		int n=(x-m),z,l;
		int i=1;
		while(i<=n)
		{
		z=i*w;
		if(z>=t)
		{
			l=z/t;
			m=m+l;
			n=n-i-l;
			
		}
		
else
	i++;
		}
		System.out.println(m);
	}
else
	System.out.println(m);

	
		
	
}

}
which test case it is missing?

Hi Harsh

For the input 10 3 1 1 output should be 6 whereas your code gives 7.

Hi @singhalharsh10081999
As you are not responding to this thread, I am marking your doubt as Resolved for now. Re-open it if required.

Please mark your doubts as resolved in your course’s “ Ask Doubt ” section, when your doubt is resolved.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.