Status:Correct Answer
Language : C(NOTE : Try a few times yourself before moving to the solution)
Status:
Correct Answer
#include <stdio.h>
int main(void) {
int t;
scanf("%d\n",&t);
while(t--)
{
long long int n;
scanf("%lld\n",&n);
long long int ans = (n*(n+1)/2) - ((n+1)/2);
printf("%lld\n",ans);
}
return 0;
}
No comments:
Post a Comment