#include <stdio.h>
#include <time.h>
int main(){
double i,j;
double wyn, need = 1.8848013598436708, now = 1.0,x=0,y=0;
clock_t startT = clock();
printf("looking for:%.16f\n",need);
for(i=1;i<1000000;i++){
for(j=(int)(i*0.54);j>=1;j--){
//printf("%f / %f = %f, diff:%f\n",i,j,i/j,need - i/j);
if( need - i/j < now && need - i/j >=0.0000000000000000){
now = need - i/j;
x = i;
y = j;
}
if( need - i/j < 0)
break;
}
//printf("\n");
}
printf("Closest founding: %d / %d = %.16f\n",(int)x,(int)y,x/y);
printf("Execution time: %ds\n",((int)((float)(clock()-startT)/CLOCKS_PER_SEC)));
return 0;
}