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

MINCOUNT Solution



#include <stdio.h>

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

	long long int h;
	scanf("%d" , &t);

	while ( t-- ) {
		scanf("%lld" , &h);
		printf("%lld\n" , (h * (h+1) / 6));
	}
	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 👇