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

#include <stdio.h>
#include <math.h>

long int n, k, hour;
double x, y;
int main(void)
{
   scanf("%ld%ld", &n, &k);
   if (n == 1)
   {
      printf("0\n");
      return 0;
   }
   n--;
   x = floor(log(k)/log(2)) + 1;
   y = pow(2, x) - 1;
   n -= y;
   hour = x;
   hour += n / k;
   if (n % k != 0)
       hour++;
   printf("%ld\n", hour);
   return 0;
}

What the fucking test.
I test this program on sophisticated tests but
vsio katu pod xvost.
:-P
if you find your mistake, please tall me.
I got WA#3 first, but now - AC.
Try K>N into your program.