My issue
include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
int t,y,d,x,og;
cin>>t;
while(t–){
cin>>d >> x>> y;
og=x;
int ct=1;
while(x>y){
if(x*(d/100.00)>1){
y=y-1;
x=og-(ct*(og*(d/100.00)));
ct++;}
else{
cout<<-1<<endl;
goto end;}
}
cout<<–ct<<endl;
}
end:
return 0;
}
Code is not being submitted although output is correct
My code
#include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
int t,y,d,x,og;
cin>>t;
while(t--){
cin>>d >> x>> y;
og=x;
int ct=1;
while(x>y){
if(x*(d/100.00)>1){
y=y-1;
x=og-(ct*(og*(d/100.00)));
ct++;}
else{
cout<<-1<<endl;
goto end;}
}
cout<<--ct<<endl;
}
end:
return 0;
}
Problem Link: International Gym Day Practice Coding Problem