ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1131. Copying

There's a problem with test case 7..This is my program
Posted by ANKUR SAKHALA 21 Mar 2016 15:46
#include<stdio.h>
int main()
{float n,k,count=0;
float m;
int i=1;
scanf("%f %f\n",&n,&k);
n=n-1;
while(n>0)
{n=n-i;
count++;
i=i*2;
if(i>=k)
{m=n/k;
i=m;
if((m-i)>0)
count=count+i+1;
else
count=count+i;
n=0;
}
}
i=count;
printf("%d",i);
return 0;
}