Magic Square

Limits: 1s, 256 MB

A little boy Towhid is good at mathematics. He solves a lot of mathematical equation regularly.


This is a companion discussion topic for the original entry at https://toph.co/p/magic-square

#include<stdio.h>
int main()
{
long long int i,T,n,a;
float b;
scanf("%lld",&T);
for(i=1; i<=T; i++){
scanf("%lld",&n);
b= ((((n*n)+1)1.00)/2);
a=b
n;
printf(“Case %lld: %lld\n”,i,a);
}

}
What’s the problem with the code??? Showing Wrong Answer in the sample test case???Plz , help.,…

I think, The judge is going crazy here .In IDE the result comes 500000500,but in the judge, it becomes 500000512!!!
What is going on???

Simplify your equation and don’t use float.
It’s solvable without using any floating point number.
Maybe your IDE is smarter and handle many errors you code. :slight_smile: