Registrations for the November 2021 System Design Cohort are now open Enroll Today

AE00 Solution



#include <iostream>
#include <cmath>
#include <cstdio>

using namespace std;

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

	int a,d;
	long int count = 0;
	float b,c;

	cin >> a;
	b=a;

	c=sqrt(b);
	d=c;

	for( int i=1 ; i <= d ; i++ ) {
		printf("%d/%d - %d-%i\n" , a,i,d,i);
		count = count + ( (a/i) - (d-i) );
	}
	
	cout << count << endl;
	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 👇