My thinking-
I tried to find out logic for this problem by analyzing various cases of n and k and took out one observation from that for every n-k steaks it takes 5 minutes.
Ohh good observation, wasn’t able to think about it
But, now it get’s wrong answer on test case 61. I think we are missing another thing also.
Here’s my code:
int main(){
int n,k;cin>>n>>k;
int cnt=0;
if(n%k==0) cnt=(n/k);
else cnt=(n/k)+1;
ll ans=cnt*5;
(ans>10)?(cout<<ans):(cout<<“10”);
return 0;
# include <bits/stdc++.h>
using namespace std;
int main ()
{
long long n, k;
cin >> n >> k;
cout << max(10ll, (n + k - 1) / k * 5) << endl;
return 0;
}