My issue
whats wrong with my solution ?
My code
#include <bits/stdc++.h>
#define ll long long
#define mod 1000000007
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
double discount, membership_cost, budget;
cin >> discount >> membership_cost >> budget;
double x = membership_cost;
int sessions = 0;
double possibility = (x -= x*((discount*budget)/100)); // checks whether the membership cost is higher then 0 even when budget is exhausted
x=membership_cost;
while (membership_cost>budget) {
if(possibility>0){
sessions=-1;
break;
}
sessions++;
budget--;
x -= x*(discount/100);
if(x<=budget){
break;
}
else{
x=membership_cost;
discount+=discount;
}
}
cout << sessions << endl;
}
return 0;
}
Problem Link: International Gym Day Practice Coding Problem