NOJ/28/main.c

19 lines
283 B
C
Raw Normal View History

2020-08-31 16:46:43 +00:00
#include <stdio.h>
int main(void){
int a,b,i = 0,k = 1;
double sum = 0.0, temp = 1.0;
scanf("%d %d",&a,&b);
while(sum <= a){
sum += 1.0/temp;
temp += 1.0/++k;
}
printf("%d ",k-1);
while(sum < b){
sum += 1.0/temp;
temp += 1.0/++k;
}
printf("%d\n",k-2);
return 0;
}