My issue
not getting logic for the 2nd input
My code
#include <iostream>
using namespace std;
int main() {
// your code goes here
int t;
cin>>t;
while(t--){
int x,y,n,r;
cin>>x>>y>>n>>r;
if(r<x && r<y)
{
cout<<-1<<endl;
}
else
{
if((r/y)<=n && (r/x)>=n)
cout<<n<<" "<<0<<endl;
else if((r/y)>=n)
cout<<0<<" "<<n<<endl;
}
}
return 0;
}
Problem Link: BURGERS2 Problem - CodeChef