TRYANGLE
CODE
import math
t=int(input())
for i in range(1,t+1):
n=int(input())
ans=(n*(n-1)*(n-2))/6
print "Case %d: %d" % (i,ans)
CODE
import math
t=int(input())
for i in range(1,t+1):
n=int(input())
ans=(n*(n-1)*(n-2))/6
print "Case %d: %d" % (i,ans)
No comments:
Post a Comment