Help me in solving TEA problem

My issue

I have tried every possible case but then also it is not accepting the solution

My code

#include <iostream>
using namespace std;

int main() {
	
	float t,x,y,z;
	cin>>t;
	while(t--)
	{
	    cin>>x>>y>>z;
	    if((x>=0)&&(y>=0)&&(z>=0))
	    {if(y>=x)
	    {cout<<z<<endl;}
	   // else
	   // {cout<<"x"<<endl;}
	    else 
	    {
	        int i=0;
	        while(x>y)
	        {i=i+1;
	         y=y*i;}
	        cout<<i*z<<endl;
	   }
	    }
	    
	}
	
	return 0;
}

Problem Link: TEA Problem - CodeChef

@aryanshinde03
plzz refer the following solution for better understanding of the logic

#include <iostream>
using namespace std;

int main() {
	
	int t,x,y,z;
	cin>>t;
	while(t--)
	{
	    cin>>x>>y>>z;
	    int r=x%y;
	    x=x/y;
	    if(r>0)
	    x++;
	    cout<<x*z<<endl;
	    
	}
	
	return 0;
}