Help me in solving BOOKPACK problem

My issue

My code

#include <iostream>
using namespace std;

int main() {
	// your code goes here
int t;
cin>>t;
while(t--)
{
    int x,y,z;
    cin>>x>>y>>z;
    if(y==z)
    {
        cout<<x<<endl;
    }
    else if(y>z)
    {
        int q=y/z;
        int f=x*(q+1);
        cout<<f<<endl;
    }
}
	return 0;
}

Problem Link: BOOKPACK Problem - CodeChef

@yuvraj07
1
3 36 12
the output will be 9 your code will print 12