If there is n*n grid cheesboard
Now find the maximum number of squares possible????
Formula:-
((n*n + n)*(2*n+1))/6 or ((n*(n+1))*(2*n+1))/6
if(n==1) ans=1;
n==2 ans=5;
n==3 ans=14;
n==4 ans=30;
Now find the maximum number of squares possible????
Formula:-
((n*n + n)*(2*n+1))/6 or ((n*(n+1))*(2*n+1))/6
if(n==1) ans=1;
n==2 ans=5;
n==3 ans=14;
n==4 ans=30;
কোন মন্তব্য নেই:
একটি মন্তব্য পোস্ট করুন