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

Y am i getting WA?? Plz Help..here's my code
Posted by swapnil vegaraju 31 Mar 2003 22:31
#include<stdio.h>
#include<stdlib.h>

int main(){
    int n,k,hrs=0,comp=1;
    int rest;
    scanf("%d %d",&n,&k);
    while(comp<=k){
        comp*=2;
        hrs++;
    }
    rest=n-comp;
    hrs+=(rest+k-1)/k;
    printf("%d",hrs);
    printf("\n");
}