My issue
include <bits/stdc++.h>
using namespace std;
define lld long double
int main()
{
long long t;
cin >> t;
while (t--)
{
lld h, x, y1, y2, k;
cin >> h >> x >> y1 >> y2 >> k;
lld a = y1 * k;
// cout<<ceil(h/y1)<<endl;
if (a <= h)
{
lld b = h - a;
// cout<<ceil(b/y2) + k<<endl;
if (ceil(h / x) <= (ceil(b / y2) + k))
{
cout << ceil(h / x) << endl;
}
else
{
// cout<<(b/y2) + k<<endl;
cout << ceil(b / y2) + k << endl;
}
}
else
{
if (ceil(h / x) <= ceil(h / y1))
{
cout << ceil(h / x)<<endl;
}
else
cout << ceil(h / y1) << endl;
}
}
// your code goes here
}
Someone pls help me in find the error in this code, it is giving wrong answer on submission.
My code
#include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
}
Problem Link: Weapon Choice Practice Coding Problem - CodeChef