September 2021 cohort is finalized with 45 amazing folks. For future cohorts Join the waitlist

FUNPROB Solution



#include <stdio.h>

int main( int argc , char * argv[] ) {

	int n,m;

	scanf("%d%d",&n,&m);

	while( n != 0 || m != 0 ) {

		if(n>m)
			printf("0.000000\n");
		else
			printf("%0.6lf\n",(double)(m-n+1)/(double)(m+1));
	
		scanf("%d%d",&n,&m);
	}

	return 0;
}

470+ Competitive Programming Solutions

If you like what you read subscribe to my newsletter.

I write essays on various engineering topics and share it through my weekly newsletter 👇