Calculate Runtime for Cubic Time Complexity